i had find out with the help of a Moderator that in the Strategy Tester the function OnChartEvent() does not work, i wanted to ask if somebody knows a trick or solution how i can get the chart event also in a Strategy backtest.
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:
if( bool( ObjectGetInteger( 0, idResetButtonObject, OBJPROP_STATE ) ) )
Print( "Reset Button Clicked" );
ObjectSetInteger( 0, idResetButtonObject, OBJPROP_STATE, false );
// Only needed in Visual Testing Mode
if( IsVisualMode() )
// Check Chart Buttons in Visual Mode
@FMIC, nice simple solution.
@PlanandTrade, depending on your use case the following solution may or may NOT be possible (for one use case of mine it worked):
To add comments, please log in or register