wildkev146: Or am I missing something obvious?
There is no chart to put the objects on.
Chart Object works fine in Visual test but returns no values in backtest
William Roeder:
There is no chart to put the objects on.
There is no chart to put the objects on.
Ok, that does make sense. Is there a workaround you can suggest? Does it need to be in the form of an indicator?
Thank you
William Roeder:
There is no chart to put the objects on.
There is no chart to put the objects on.
Further digging around the MQL manuals, I found this page https://docs.mql4.com/runtime/testing
In it, there is this section
During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.
Unfortunately it doesn't give guidance on how to get workaround it
Thanks
Operation of Programs in the Strategy Tester - MQL4 programs - MQL4 Reference
- docs.mql4.com
There are operation limitations for some functions in the client terminal's Strategy Tester. Calling that functions leads to error 4059 (Function is not allowed in testing mode). The Sleep() Function The Print() and PrintFormat() Functions To increase performance, Print() and PrintFormat() functions are not executed when optimizing the trading...
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
Hi,
I've written a piece of code that creates a linear regression object on the chart based recent swings. I then need to use the values from the upper and lower channel in my trade criteria. When I run it in visual backtest mode, everything works fine. When I turn off the visual mode, it stops working. Instead of returning the values of the lines as it did in visual mode, it returns 0.
Below is the code used to create the object where swinghighdate is an array containing the bar the swing occurred on. This is sending correct information verified by Journal
Below is the code I use to get the value of the channels for the last bar
I'm not sure how to solve this. Is it a problem with the RAY_RIGHT not extending and therefore there is no channel at that value? Or am I missing something obvious?
Any help would be appreciated
Thanks