How to use something like SetIndexShift() to render an OBJECT ahead of the most current candle?

To add comments, please log in or register
David McCollum
33
David McCollum  

Is there a way to use something like SetIndexShift() to render an OBJECT ahead of the most current candle? I'd like to draw something like an OBJ_RECTANGLE, and locate it by replacing Time[] as an argument with a X candle index shift forward from the most current candle.


I tried to do the following:

int Kijun = 26;

ObjectCreate("KumoLeadMarker" + iObjTotal,OBJ_RECTANGLE,0,(Time[0]+(60*60*4*Kijun)),iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANA, -Kijun) - 0.00200,(Time[0]+(60*60*4*Kijun)),iIchimoku(NULL, 0, Tenkan, Kijun, Senkou, MODE_SENKOUSPANA, -Kijun) + 0.00200);


If Time[0] and the result of added to Time[0] both fall within the same week, then this works fine. If they fall within two different weeks, then it does not work correctly. The shift forward is not one of an absolute time, but one of X candles.


Any help is most appreciated!!!


Regards,



DMMcCollum

Ray
2646
Ray  

there is no setting to tell MT4 about weekends

So, if you want to set things x bars into the future and avoid weekends you have to calculate it out.

David McCollum
33
David McCollum  
phy:

there is no setting to tell MT4 about weekends

So, if you want to set things x bars into the future and avoid weekends you have to calculate it out.

Phy - I was afraid of that ..hehe.. thanks for the reply. I guess it will just come down to some creative math.


Thanks again...

To add comments, please log in or register