C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,111 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
Cant understand why += wont sum in this context my variable difCP .
if(CurrentBar < 1) return;
DateTime MyDateTime9 = new DateTime(Time[0].Year,Time[0].Month, Time[0].Day, 09, 30, 0);
DateTime MyDateTime16 = new DateTime(Time[0].Year,Time[0].Month, Time[0].Day-1, 16, 00, 0);
Print("time"+ChartBars.GetBarIdxByTime(ChartControl, MyDateTime9));
Print("time"+ChartBars.GetBarIdxByTime(ChartControl, MyDateTime16));
double difCplus = 0;
double closePrice16 = Bars.GetClose(Bars.GetBar(MyDateTime16));
double closePrice9 = Bars.GetClose(Bars.GetBar(MyDateTime9));
double difCP = closePrice16 - closePrice9;
difCplus += difCP;
Print("dif"+difCP);
Print("CP"+closePrice16);
Print("CP"+closePrice9);
Print("DP"+ difCplus);
double candle = Close[0] + difCplus;
Print("Can"+candle);
difCplus is Printed does not return a cumulative sum.
-2,10,-2
it should return -2, 8, 6
TY
Hi
label6.Text=DateTime.Now.Month.ToString()+"/"+DateTime.Now.Year.ToString();
for (int i=1;i<13;i++)
{
comboBox1.Items.Add(dt.GetMonthName(i).ToString());
}
//Cant use +=
Best Regards.
Please remember to mark the replies as answers if they help.