Manually open/close positions in the tester?

 

Hi guys,

someone kindly knows if it is possible to open/close positions manually in the tester?

 

I tried to put a button and use OnChartEvent() like in: https://www.mql5.com/en/docs/eventfunctions/eventchartcustom 

but it did not work.

 

any suggestions? 

thanks

 

ugo

Documentation on MQL5: Working with Events / EventChartCustom
Documentation on MQL5: Working with Events / EventChartCustom
  • www.mql5.com
Working with Events / EventChartCustom - Reference on algorithmic/automated trading language for MetaTrader 5
 
ugo:

Hi guys,

someone kindly knows if it is possible to open/close positions manually in the tester?

I tried to put a button and use OnChartEvent() like in: https://www.mql5.com/en/docs/eventfunctions/eventchartcustom 

No, unfortunately it's not possible.

Regarding the button idea, there are several limitations to use objects on the Strategy Tester, so, unfortunately this idea will not work as well.

 
ugo:

Hi guys,

someone kindly knows if it is possible to open/close positions manually in the tester?

 

I tried to put a button and use OnChartEvent() like in: https://www.mql5.com/en/docs/eventfunctions/eventchartcustom 

but it did not work.

 

any suggestions? 

thanks

 

ugo

its a good question. I would sinput a int which relates to the bar count so say i set it to ten then it will count ten bars then set it to pop up a messagebox askin me if i want to open an buy order then a sell order if cancel none otherwise order and continue another ten bars or i would set it so that the box comes up when an interesting trigger like rsi 70 is hit or somethin but you can't just hit an order button directly so use your imagination.
 
There is an MT4 simulator out there that lets you do this. It uses scripts to open/close/modify positions. Can't think of the name of it right now but will have a look when I get home. Or you should be able to find it with a bit of googling.
 
Thecreator1:
its a good question. I would sinput a int which relates to the bar count so say i set it to ten then it will count ten bars then set it to pop up a messagebox askin me if i want to open an buy order then a sell order if cancel none otherwise order and continue another ten bars or i would set it so that the box comes up when an interesting trigger like rsi 70 is hit or somethin but you can't just hit an order button directly so use your imagination.
MessageBox() is not triggered in the tester. This ether would not work.