From fa2468126cb51576bf613e61069c2bee1fa209ca Mon Sep 17 00:00:00 2001 From: "DESKTOP-1A3P75F\\lee" Date: Wed, 15 Mar 2023 21:37:58 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=8B=9C=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BolingerConditionSetup.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Million/IndicatorConditionSetup/BolingerConditionSetup.cs b/Million/IndicatorConditionSetup/BolingerConditionSetup.cs index c524f8e..b87cdfd 100644 --- a/Million/IndicatorConditionSetup/BolingerConditionSetup.cs +++ b/Million/IndicatorConditionSetup/BolingerConditionSetup.cs @@ -48,7 +48,7 @@ namespace Million.IndicatorConditionSetup public override string GetKeyName(bool IndexStr = false) { - var key = "Bol" + Period + Squared; + var key = "Bol"+ (Indicator_BolingerOverLine==CommonProperty.Indicator_BolingerOverLine.하향선?"U":"") + Period + Squared; if (IndexStr) return IndexString + key; return key; @@ -115,10 +115,20 @@ namespace Million.IndicatorConditionSetup t_Low += Math.Pow(data[j].LowValue - average_Low, 2); t_Close += Math.Pow(data[j].EndValue - average, 2); - bol.startValue = average_Open + Squared * Math.Sqrt(t_Open / Period); - bol.highValue = average_High + Squared * Math.Sqrt(t_High / Period); - bol.lowValue = average_Low + Squared * Math.Sqrt(t_Low / Period); - bol.value = average + Squared * Math.Sqrt(t_Close / Period); + if(Indicator_BolingerOverLine == CommonProperty.Indicator_BolingerOverLine.하향선) + { + bol.startValue = average_Open - Squared * Math.Sqrt(t_Open / Period); + bol.highValue = average_High - Squared * Math.Sqrt(t_High / Period); + bol.lowValue = average_Low - Squared * Math.Sqrt(t_Low / Period); + bol.value = average - Squared * Math.Sqrt(t_Close / Period); + } + else + { + bol.startValue = average_Open + Squared * Math.Sqrt(t_Open / Period); + bol.highValue = average_High + Squared * Math.Sqrt(t_High / Period); + bol.lowValue = average_Low + Squared * Math.Sqrt(t_Low / Period); + bol.value = average + Squared * Math.Sqrt(t_Close / Period); + } IndicatorData.OverChecker(data[i], bol, data[i - 1].IndicatorDic[bolKeyName].indicator_over);