Download MetaTrader 5
To add comments, please log in or register
Move from theory to practice. Code Base will help you!
BurkhardWille
143
BurkhardWille 2015.10.15 23:14 

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

Doerk Hilger
1074
Doerk Hilger 2015.10.16 12:19  
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. 
Alain Verleyen
Moderator
28693
Alain Verleyen 2015.10.16 14:05  
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.
BurkhardWille
143
BurkhardWille 2015.10.16 14:33  
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.

Alain Verleyen
Moderator
28693
Alain Verleyen 2015.10.16 14:39  
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.
Doerk Hilger
1074
Doerk Hilger 2015.10.17 09:02  
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.

Marco vd Heijden
Moderator
4079
Marco vd Heijden 2015.10.17 09:32  

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.

/
To add comments, please log in or register