Hotkey-Function in EA for backtesting

 

Hi,

I saw a usefull EA http://www.forexfactory.com/showthread.php?t=445367, unfortunately only as ex4-file, I am interesting in the code for creating interaction with hotkey_buy 'B' and hotkey_sell 'S' to open market positions in the tester during the visial mode.

In the MetaEditor help I cant find an example of creating hotkeys for expert advisor without an extra dll.


Maybe someone has an example of a simple code for hotkey-interaction in the backtester.

Note: I don't mean hotkeys in combination with a script.


Warm Regards

Burkhard

 
BurkhardWille:

Hi,

I saw a usefull EA http://www.forexfactory.com/showthread.php?t=445367, unfortunately only as ex4-file, I am interesting in the code for creating interaction with hotkey_buy 'B' and hotkey_sell 'S' to open market positions in the tester during the visial mode.

In the MetaEditor help I cant find an example of creating hotkeys for expert advisor without an extra dll.


Maybe someone has an example of a simple code for hotkey-interaction in the backtester.

Note: I don't mean hotkeys in combination with a script.


Warm Regards

Burkhard

This can't be done without using at least the winuser32.dll, but it's not a big deal. 
 
Doerk:
This can't be done without using at least the winuser32.dll, but it's not a big deal. 
Wrong, it can be done with mql4/mql5 only.
 
Alain Verleyen:
Wrong, it can be done with mql4/mql5 only.


great, any code-example? I need only a small note, where I can find it in the help file.

 
BurkhardWille:


great, any code-example? I need only a small note, where I can find it in the help file.

You need an indicator to catch the chart events, as they don't work with EA in the Strategy Tester. Then you dispatch this event to your EA.
 
Alain Verleyen:
Wrong, it can be done with mql4/mql5 only.

You again ;)

 ... yes, you´re right.

Btw: I never tried to include indicators with the CreateRessource function. Does this work with own indicators which implement functionalities like these? Anyway I never understood why OnChartEvent is dead in Strategy-Tester within EAs. But ok, it is as it is. If you know how this works, I could pass this as a job to you if you´re interested.

 

I don't understand many things... but we have to live with them.

Probably it's related to a speed issue, tester will get very sluggish with a lot of baggage.

It was not designed for manual button press interception, it was designed to calculate results, fast.

To test automated strategy's and not to train manual traders.

I agree, in non visible mode it does not serve any purpose, but in visual mode it could be of great value.

Reason: