The incorrect output position of the text object created
Dear all,
I used the following code in my EA to create a text object at a position higher than the current bar's High.
But the output of the text object is always lower than the position specified. ( No objectCreate failure err or ObjectSetText error was reported. ) As shown in the picture below. You can copy the code and compile it as an EA you will see the output during backtest....
May I know what is wrong with my code?Thanks a lot for your time and consideration.
You are drawing the Object on Bar 0 when the High and Low are not yet known, draw it on Bar 1 instead.
Dear RaptorUK,
You definitely pinpoint the error I made! thank you so much!
I used the following code in my EA to create a text object at a position higher than the current bar's High.
But the output of the text object is always lower than the position specified. ( No objectCreate failure err or ObjectSetText error was reported. ) As shown in the picture below. You can copy the code and compile it as an EA you will see the output during backtest....
May I know what is wrong with my code?Thanks a lot for your time and consideration.