How to open a position without opening a position?

 

Hello friends,

This question is both for MQL5/4.

I want to open a position based on recent positions data(All data including Open/Close Price, Open/Close  Time, Profit<Swap+ Commission+ gross profit>, Slippage, Lot Size) while the positions would have dynamic sl/tps.

The simple solution is to open all of the positions, however sometimes I know I should NOT open the position due to poor Risk/Reward ratio and other metrics. But I need above data about that poor position too, to decide about the next position parameters.

Is there any solution to open a position without opening a position? So I can collect the data without losing money :p

Higher accuracy would be preferred.

Your advice is greatly appreciated!

 
HosseinKOGO:

Hello friends,

This question is both for MQL5/4.

I want to open a position based on recent positions data(All data including Open/Close Price, Open/Close  Time, Profit<Swap+ Commission+ gross profit>, Slippage, Lot Size) while the positions would have dynamic sl/tps.

The simple solution is to open all of the positions, however sometimes I know I should NOT open the position due to poor Risk/Reward ratio and other metrics. But I need above data about that poor position too, to decide about the next position parameters.

Is there any solution to open a position without opening a position? So I can collect the data without losing money :p

Higher accuracy would be preferred.

Your advice is greatly appreciated!

Yes , you can , you will emulate the behavior of an open position just like the tester would .

You want to evaluate the signal as a whole without the restriction of margins or prior trades  

 
Lorentzos Roussos #:

Yes , you can , you will emulate the behavior of an open position just like the tester would .

You want to evaluate the signal as a whole without the restriction of margins or prior trades  

How could it be possible? Is there any ready made function/include file that can be used for this? Or I should develop it at my own?

 
HosseinKOGO #:

How could it be possible? Is there any ready made function/include file that can be used for this? Or I should develop it at my own?

It's not hard actually if you want to measure the performance of the signal with tp and sl

You need open time , open price , sl tp (if they are zero you don't check) if the ask changes you check the sells if the bid changes you check the buys)

You can completely skip the default functions btw and initially evaluate the signal like this .

 
Lorentzos Roussos #:

It's not hard actually if you want to measure the performance of the signal with tp and sl

You need open time , open price , sl tp (if they are zero you don't check) if the ask changes you check the sells if the bid changes you check the buys)

You can completely skip the default functions btw and initially evaluate the signal like this .

The SL and TP are not on the server. They are dynamic and hidden. Actually trigger by TPCloser function and SLCloser function.

I should check Swap and commissions daily for accurate results and harder, check the slippage when I virtually open and close the position.
I know the actual slippage is not accessible, however the first available price after a fixed some of milliseconds I trigger the virtual position is enough.

Orange: for the Market Execution purpose
Blue: for the latency between my mt4/5 and the broker's server.

 
HosseinKOGO #:

The SL and TP are not on the server. They are dynamic and hidden. Actually trigger by TPCloser function and SLCloser function.

I should check Swap and commissions daily for accurate results and harder, check the slippage when I virtually open and close the position.
I know the actual slippage is not accessible, however the first available price after a fixed some of milliseconds I trigger the virtual position is enough.

Orange: for the Market Execution purpose
Blue: for the latency between my mt4/5 and the broker's server.

Yeah , the swaps and commissions is a pain point indeed as there is no historical access for it.

You can emulate the slippage and have a "pessimistic" overall approach to the test in that case . The dynamic SLTP is actually kinda how you will approach the other aspects of the virtual trades . So as you have virtualized the sl tp you will do the same for the opening / closing 

However if your system takes one trade per symbol you will have to adapt the structures to allow "all signals" to be "virtually traded" if you want to evaluate the signal.

Something to ponder on : If your strategy -or any strategy- takes a trade and then this taken trade blocks the strategy from taking more trades , or , hogs the margin of the account in the tester , the signals that come in during that trades lifespan are not evaluated in the tester essentially because you are not taking those trades.