Are object events possible (button press) in the EA strategy tester (visual tester)? - page 2

 
Ryan L Johnson #:

Fair enough. You stated EA and Tester in the title of this thread, so my bad for posting a link to an indicator. Thank you for clarifying.

If you're willing to be bothered by manually adding indicators, the SimSim indicator is merely a chart replay utility. I just loaded it and popped a moving average onto the chart, and both the bars and the moving average populated in synchronized simulated time.

Of course, "Simple" is built into the name of the indicator so I see what you mean.

the Visual tester is actually the ideal replay system I think as it allows you to control the speed of higher timeframe price data with a speed dial. I don't know if the articles on replay systems have that in mind

this is what I have so far, all is working well (and I copied over the trade logic from an older EA), still developing it further

 
Conor Mcnamara #:

the Visual tester is actually the ideal replay system I think as it allows you to control the speed of higher timeframe price data with a speed dial. I don't know if the articles on replay systems have that in mind

this is what I have so far, all is working well (and I copied over the trade logic from an older EA), still developing it further

The first inputs listed in the CodeBase for the SimSim utility are:

  • Configure inputs; start bar, cycle speed (recommended 2 seconds minimum)

But in the SimSim utility, only close prices are referenced.

In contrast, your EA is clearly running on ticks.👍
 

Simply use OnTick and OnTimer and call a worker function which reads the mouse position and its state. Make sure function is restricted to lets say 5ms, so that not everything is blocked.

In that worker-function you then patch the values to the format of OnChartEvent and you call OnChartEvent from there. 

Works. 

But regular buttons wont work, create some own, which is very easy. 

 
Doerk Hilger #:

Simply use OnTick and OnTimer and call a worker function which reads the mouse position and its state. Make sure function is restricted to lets say 5ms, so that not everything is blocked.

In that worker-function you then patch the values to the format of OnChartEvent and you call OnChartEvent from there. 

Works. 

But regular buttons wont work, create some own, which is very easy. 

You might have missed reading previous posts, already been solved. There isn't a need to use both OnTick and OnTimer, it's one or the other 
 
Conor Mcnamara #:
You might have missed reading previous posts, already been solved. There isn't a need to use both OnTick and OnTimer, it's one or the other 

No I did. The reasons for my suggestion is:

1. OnTick has higher priority than OnTimer. It might happen, that OnTimer is delayed when many ticks come in, same like OnChartEvent. At least live. And yes, you need to limit the frequency and measure the timing. 

2. In MT4 you have no timer in the tester. Our solution works on both, MT4 and MT5, thats why. 

You can even go a step further by just setting a flag when a tick comes in and also handle the ticks in OnTimer in MT5. Depending of the complexity of your calculation in OnTick() and on the number of charts, this can help you to survive when news kick in. Everything will stay smooth.