Anti slippage / Slip protection

 

Hey Guys!  I need help to program to program an antislippage. I try to explain:
I place a pending order with a stop loss of 5 pips. Imagine that when you enter the market there is a 2 pip slippage. The stop loss will then be 7 pip from the entry point: 5 pip + 2 of slippage. I would like to find a way to modify the stoploss so that, after entering the market, get up 2 pip (slippage) and reposition to 5 pip from the entry point.

Thanks for your help!

 
Stefano Oddo:

Hey Guys!  I need help to program to program an antislippage. I try to explain:
I place a pending order with a stop loss of 5 pips. Imagine that when you enter the market there is a 2 pip slippage. The stop loss will then be 7 pip from the entry point: 5 pip + 2 of slippage. I would like to find a way to modify the stoploss so that, after entering the market, get up 2 pip (slippage) and reposition to 5 pip from the entry point.

Thanks for your help!

Please show your code if you need coding help.
 

This is just exampple.  Imagine that there is a pending order BUY that has a stop loss:

double STLBUY= ORDER_BUY - 50* Point

With this code the SL should be 5 pip away from the entry point ("Order_Buy"). If, however, there is a 2 pip slippage, the entry point will rise by 2 pips while the SL will remain in its original position (-5 pips from the Order Buy without slippage)

 
Stefano Oddo:

This is just exampple.  Imagine that there is a pending order BUY that has a stop loss:

double STLBUY= ORDER_BUY - 50* Point

With this code the SL should be 5 pip away from the entry point ("Order_Buy"). If, however, there is a 2 pip slippage, the entry point will rise by 2 pips while the SL will remain in its original position (-5 pips from the Order Buy without slippage)

No need to repeat, it was already clear.

Forum on trading, automated trading systems and testing trading strategies


Alain Verleyen, 2016.03.30 10:46

Welcome,

  • Usually people who can't code don't receive free help on this forum, though it could happen if you are lucky, be patient.
  • If you show your attempts and describe well your problem, you will most probably receive an answer from the community.
  • If you don't want to learn to code, nothing bad, you can either look at the Codebase if something free already exists, or in the Market for paid products (sometimes free also).
  • Finally, you also have the option to hire a programmer in the Freelance section.

Good luck.


Reason: