Trailing stop on IB – Stop repositioning on DAX

Forums ProRealTime English forum ProOrder support Trailing stop on IB – Stop repositioning on DAX

Viewing 8 posts - 1 through 8 (of 8 total)
  • #218584


    I want to implement trailing stops in  my strategies on DAX Futures (DXS and DXM) on IB. There is a limitation in terms of stop repositioning to 10 times, sometimes more but I would rather stick to 10.

    I have found trailing stops codes but I am wondering how to set the numbers of iterations.

    Therefore I would like to use a loop like For i=1 to 10… to take profit when stop is touched after the 10th repositioning.

    Has anyone already coded this? Or maybe such topic already exists.

    Thanks for your help.



    Can you make an example?



    Sure, it would look like this but I am not sure about the syntax/use:





    I think it’s better to use a “counter” (Step=Step+1) than a loop…

    You can then just let the trailing stop do its job and stop after 10 steps…

    1 user thanked author for this post.

    The lines from 30 through the end are logically incorrect. You can’t use iterations that way. I can’t understand the goal you want to achieve.

    Can you write an exemple using just text?



    Yes @Roberto, I just want to code a trailing stop that moves the stop 10 times at most.


    There you go (not tested):



    Thanks. I will test it tomorrow.

Viewing 8 posts - 1 through 8 (of 8 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login