Ruud Op: I use an EA I designed myself for allowing me to enter trades per hotkey and with mouse clicks. If the Strategy Tester would listen to mouse events and key events I could trade with hotkeys in the Strategy Tester any time I want. This feature is missing though and I regret this. This would also help me with backtesting manual strategies. Could you please be so kind to make the Strategy Tester listen to mouse and key events?
You can detect button states in the Strategy Tester as a work-around for mouse clicks chart events.
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; }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Dear MT5 Team,
I use an EA I designed myself for allowing me to enter trades per hotkey and with mouse clicks.
If the Strategy Tester would listen to mouse events and key events I could trade with hotkeys in the Strategy Tester any time I want. This feature is missing though and I regret this. This would also help me with backtesting manual strategies.
Could you please be so kind to make the Strategy Tester listen to mouse and key events?
Furthermore, I just like to say that I love MT5!
Warm regards,
Ruud op het Veld