I want to run my trading panel on the MT4 strategies tester and it doesn't work there, only on the market lives, please any help will be okay...
The strategy tester is limited in functionality, especially when dealing with chart events. So you will have to study your code and make changes, considering those limitations.
For example, the button click events don’t work, but there are a few workarounds for it. However, not all functionality can be solved this way, only some.
Forum on trading, automated trading systems and testing trading strategies
OnChartEvent() not called in Expert Advisor (EA)
Fernando Carreiro, 2016.05.21 22:13
As GumRai has stated, when testing EA's, the "OnChartEvent()" does not work (it only works in "real-time", not in the "Strategy Tester").
However, depending on what kind of Chart Event you are trying to implement, some of them can be "simulated" with some extra code. In the following post, I used some code to simulate and check when a button is clicked: https://www.mql5.com/en/forum/149901
Forum on trading, automated trading systems and testing trading strategies
Chart Event For MT4 Backtester
Fernando Carreiro, 2016.04.03 15:40
I know this is a an old thread, but I recently needed to debug some of my code that implements "buttons" to control certain aspects of an EA I was coding and had need for it to work in the Strategy Tester.
The solution I came up with was to check the button states on every incoming tick when the EA was in Visual Mode.
In other words, something like this:
void CheckResetButton() { if( bool( ObjectGetInteger( 0, idResetButtonObject, OBJPROP_STATE ) ) ) { Print( "Reset Button Clicked" ); ObjectSetInteger( 0, idResetButtonObject, OBJPROP_STATE, false ); } } void OnTick() { // Only needed in Visual Testing Mode if( IsVisualMode() ) { // Check Chart Buttons in Visual Mode CheckResetButton(); } return; }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use