Hi,

There is no way to add to OHLC. But there is solution to this.

check this:

//Shifting arrays
futOpen = Ref(Open, 2);
futClose = Ref(Close, 2);
futHigh = Ref(High, 2);
futLow = Ref(Low, 2);

//calculate new bars
futOpen[BarCount-2] = futOpen[BarCount-3];
futClose[BarCount-2] = futClose[BarCount-3];
futHigh[BarCount-2] = futHigh[BarCount-3]*1.02;
futLow[BarCount-2] = futLow[BarCount-3]*0.99;

futOpen[BarCount-1] = futOpen[BarCount-2];
futClose[BarCount-1] = futClose[BarCount-2];
futHigh[BarCount-1] = futHigh[BarCount-2]*1.01;
futLow[BarCount-1] = futLow[BarCount-2]*0.99;


//plot is shifted !!! use xshift param if you need to plot it correctly
PlotOHLC(futOpen, futHigh, futLow, futClose, "", colorBlack);

//calc indicator on calulated values is is shifeted as well!!!
MyMA = MA(futClose, 10);
Plot(MyMa, "", colorBlue, styleLine);

Y


Reply via email to