Download MetaTrader 5

graphical objects issue in backtest

To add comments, please log in or register


I draw a trendline into the chart and save the template as "tester". Then I run a backtest, when the price hits the trendline an order shall be placed. When the backtest starts, the trenline is drawn but shiftet to the right. I select the trendline and check the parameters. They are exactly as they should be. After clicking the ok-button the trendline jumps back to the place where I draw it first (where it should be).

I would be thankfull for any idea how I could solve this issue!


edit: ObjectGet deliveres the values stored in the object not the values where the object is placed. So I probably can work with it. But it would be nice to know why that issue occurs.


solved (if someone else has the same problem, too):

cycle through object, get objects values and set the objects with same values places them where they should be be placed.

int counter = ObjectsTotal();
    while(counter >=0)
    string name = ObjectName(counter);
    datetime time1 = ObjectGet(name,OBJPROP_TIME1);
    datetime time2 = ObjectGet(name,OBJPROP_TIME1);
To add comments, please log in or register