CalculateOnBarClose = false;
Add(PeriodType.Minute,15);
Calling below code on OnStartUp()
private void PrintOHLCvaluesfortimebars(int fromxbars,int to_ybars) { var instance = new GetBuySellPrint(); double open = 0; double high =0; double low= 0; double close =0; double prevbarhigh =Highs[1][fromxbars]; double prevbarlow =Lows[1][fromxbars]; for(int x=fromxbars;x<to_ybars;x++) { high = Highs[1][x]; low = Lows[1][x]; Print("Some high="+ Highs[0][x]); Print("Some low ="+ Lows[0][x]); if(Math.Round(high,2)>=Math.Round(prevbarhigh,2)) { prevbarhigh = high; } if(Math.Round(low,2)<=Math.Round(prevbarlow,2)) { prevbarlow = low; } } }
Some high=103.34
Some low =103.31
Some high=103.34
Some low =103.27
Some high=103.4
Some low =103.29
Some high=103.43
Some low =103.39
barstillpitopen = -1
barstillglobexopen = 4
Which should have been in fact in the range 104.15 to 104.23 .
Why am i getting junk values.?
Please help.
I wanted historical highs and lows of 15 min bars from some x time to y time.
Comment