You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Who would have thought that would be the solution, eh?
I agree on your solutions earlier @honest_knave
just want clarifications in OnTick handle, for double value keep switching from 0 it it's double value.
I agree on your solutions earlier @honest_knave
just want clarifications in OnTick handle, for double value keep switching from 0 it it's double value.
Yes, as I mentioned earlier your code creates the object every single tick (if it already exists, your code deletes it then recreates it).
If you don't wait long enough, you will get 0.
If you do wait long enough, you will get the correct value.
TBH, there is a lot of unnecessary code. This will give you the correct value right from the first tick:
Yes, as I mentioned earlier your code creates the object every single tick (if it already exists, your code deletes it then recreates it).
If you don't wait long enough, you will get 0.
If you do wait long enough, you will get the correct value.
TBH, there is a lot of unnecessary code. This will give you the correct value right from the first tick:
Thanks @honest_knave, really appreciate it. :)
I'm having a similar issue to this :
I've got the equivalent of above working, I'm able to capture the OBJ_REGRESSION values via ObjectGetValueByTime
But.... this only works using the visual mode strategy test, otherwise it just returns 0 (as in the problem above)
I know that Sleep has no impact on a Strategy Test is ChartRedraw the same?
or is there any way to simulate/force a tick via code to solve the strategy tester issue?
I'm having a similar issue to this :
I've got the equivalent of above working, I'm able to capture the OBJ_REGRESSION values via ObjectGetValueByTime
But.... this only works using the visual mode strategy test, otherwise it just returns 0 (as in the problem above)
I know that Sleep has no impact on a Strategy Test is ChartRedraw the same?
or is there any way to simulate/force a tick via code to solve the strategy tester issue?
I tried separately adding a horizontal line and then deleting it, hoping that it would somehow refresh, but it seems the chart isn't re-drawn until after the OnTick() has processed
I'm having a similar issue to this :
I've got the equivalent of above working, I'm able to capture the OBJ_REGRESSION values via ObjectGetValueByTime
But.... this only works using the visual mode strategy test, otherwise it just returns 0 (as in the problem above)
I know that Sleep has no impact on a Strategy Test is ChartRedraw the same?
or is there any way to simulate/force a tick via code to solve the strategy tester issue?
Anyone got any ideas?
Is it impossible? so basically ObjectGetValueByTime won't work via Strategy Tester
Will creating OBJ_REGRESSION lines via an Indicator and then calling from the EA help?
Is it worth putting this question to the Freelance section?
I've tried this:
https://www.mql5.com/en/forum/280520
Same issue, values aren't populated until after the tick while using Strategy Tester (in non visual mode) rendering ObjectGetValueByTime useless
May have to resort to looping all the values into an array and then calculating the Intercept/Gradient manually
I've tried this:
https://www.mql5.com/en/forum/280520
Same issue, values aren't populated until after the tick while using Strategy Tester (in non visual mode) rendering ObjectGetValueByTime useless
May have to resort to looping all the values into an array and then calculating the Intercept/Gradient manually
iRick,
Did you ever manage to get this sorted? I'm having the exact same problem now. I have tried the link you posted, I have tried using ObjectGetValueByShift as well... It doesn't seem to matter what I do, I get 0 during non-visual backtesting. I appreciate that this is a year since your last message but it's worth a shot
Thanks
Thanks. All of you. I had the same problem and couldn't figure this one out.
Although I use ChartRedraw() in my code no matter how long I've waited (several ticks, minutes), ObjectGetValueByTime() always returned 0.0.
Same happened with a direct Sleep(50) statement in the code before using ObjectGetValueByTime().
After that I've done what seems to be unnecessarily complicated - and it works. :)