Open Prices Only Effect on Active SL & TP - page 2

 
koranged:I agree with you, like I say it was just a hypothetical to throw out there, I can use tick data instead, it's just the open prices only method is obviously a lot faster :). 

Then make sure the conditions are met or change your code and use the method explained by @Enrique Dangeroux of using the M1 Open Prices only (but forcing a the higher time-frame in your code).

 
Fernando Carreiro:

Then make sure the conditions are met or change your code and use the method explained by @Enrique Dangeroux of using the M1 Open Prices only (but forcing a the higher time-frame in your code).

I will bare the M1 method in mind, but will probably just use tick data for all backtests and sacrifice the speed offered by open prices only. Thanks a lot to everyone for their input. 

 
koranged: I will bare the M1 method in mind, but will probably just use tick data for all backtests and sacrifice the speed offered by open prices only. Thanks a lot to everyone for their input. 

For single back-tests, I recommend tick-data, in order to see if everything is working correctly.

For optimisations of many parameters, you can do an initial run based on M1 Open prices first, and then you can select the best combinations and run a second round of optimisations with tick data with only a restricted set of parameters to fine-tune.

 
Fernando Carreiro:

For single back-tests, I recommend tick-data, in order to see if everything is working correctly.

For optimisations of many parameters, you can do an initial run based on M1 Open prices first, and then you can select the best combinations and run a second round of optimisations with tick data with only a restricted set of parameters to fine-tune.

Right okay. Thanks a lot for all that information. 

 
koranged: Right okay. Thanks a lot for all that information. 

Also, remember than in the Strategy tester, all stops (S/L & T/P and pending orders) will be hit at the exact price with no slippage and not the real underlying prices.

So, use virtual stops (virtual pending orders) so that you get a true prices being hit with slippage and not the fictitious ones set on the order.

 
Fernando Carreiro:

Also, remember than in the Strategy tester, all stops (S/L & T/P and pending orders) will be hit at the exact price with no slippage and not the real underlying prices.

Yes I am cautiously aware of this.

Fernando Carreiro:

So, use virtual stops (virtual pending orders) so that you get a true prices being hit with slippage and not the fictitious ones set on the order.

When you say a 'virtual stop', do you mean a market order that is triggered upon certain conditions becoming true, rather than setting an actual stop? If so, how exactly does this help with the issue of slippage?

If this isn't at all what you mean then would you mind just explaining what a virtual stop is?

 
koranged:

Yes I am cautiously aware of this.

When you say a 'virtual stop', do you mean a market order that is triggered upon certain conditions becoming true, rather than setting an actual stop? If so, how exactly does this help with the issue of slippage?

If this isn't at all what you mean then would you mind just explaining what a virtual stop is?

Yes, but that deepens on whether you are using MT4, MT5 Hedging or MT5 Netting. If it is for MT4 or MT5 Hedging, then it is just a closing of the open position when the stop price is reached.

The reason this helps with the slippage is because the Strategy Tester closes at the exact price of the Stop and not at the underlying market price. For example, lets say you have a stop-loss at 1.2134 (buy order) and the bid price is currently at 1.2135 (1 pip above the stop) and then on the next tick the bid price is 1.2130 (4 pips below the stop). The strategy tester will show that the position was closed at 1.2134 (the exact S/L price) instead of it actually being closed at 1.2130 if it were on a real account. When you use virtual stops and virtual pending orders this problem is minimized.

 
Fernando Carreiro:

Yes, but that deepens on whether you are using MT4, MT5 Hedging or MT5 Netting. If it is for MT4 or MT5 Hedging, then it is just a closing of the open position when the stop price is reached.

The reason this helps with the slippage is because the Strategy Tester closes at the exact price of the Stop and not at the underlying market price. For example, lets say you have a stop-loss at 1.2134 (buy order) and the bid price is currently at 1.2135 (1 pip above the stop) and then on the next tick the bid price is 1.2130 (4 pips below the stop). The strategy tester will show that the position was closed at 1.2134 (the exact S/L price) instead of it actually being closed at 1.2130 if it were on a real account. When you use virtual stops and virtual pending orders this problem is minimized.

Ah right. I didn't realise this was the case. So  basically slippage is not accounted for in the case of pending orders, but is to a certain extent with market orders. 

 
koranged: Ah right. I didn't realise this was the case. So  basically slippage is not accounted for in the case of pending orders, but is to a certain extent with market orders. 

It is not accounted for in neither pending orders nor stops on market orders. It only works if you open and close the Market orders without ever using stops. Obviously your code, has to have both possibilities, so that once it gets used live it can then use normal hard stops and pending orders if you wish.

 
Fernando Carreiro:

It is not account for in neither pending orders nor stops on market orders. It only works if you open and close the Market orders without ever using stops. Obviously your code, has to have both possibilities, so that once it gets used live it can then use normal hard stops and pending orders if you wish.

Okay thanks Fernando.

Reason: