Trailing stoploss problems

Forums ProRealTime English forum ProOrder support Trailing stoploss problems

  • This topic has 2 replies, 3 voices, and was last updated 6 months ago by avatarJS.
Viewing 3 posts - 1 through 3 (of 3 total)
  • #222267

    Hi there,

    I’ve been tinkering on this bit of code for several days and cannot figure out how to eliminate several behaviors:

    1. It sometimes places a negative stoploss. It should only start to place a stoploss when the position is breakeven yet at times it will place a stoploss at a loss…
    2. It sometimes does, sometimes does not increase the trailing stoploss. Obviously, it should always increase whenever possible

    Thanks for the help, I’m really confused about what it is I’m not getting…

     

    #222275

    I have submitted your problem to I.A, hereinafter the answer:

    Incorrect calculations: Calculations for shortbreakeven, Fullshortexitet stop-loss conditions seem to correspond to arbitrary price levels ( minsteps, positionprice). These values should be based on the actual performance of the position.

    Initializing Variables: There is no ShortStopProfit, which can cause problems.

    Fuzzy logic: The logic to determine when to place a stop-loss or increase it seems complex and possibly subject to

    Exit conditions:

    Using BarIndex: Using BarIndexpor to measure profit time can be prone to errors as it depends on the number of bars you have loaded and the frequency of your data.

    Management of Short Positions: The code seems mainly intended for the management of short positions. Make sure this fits your trading strategy.

    To correct these problems, it may be necessary to rethink the logic of position management and adapt the

    #222284
    JS

    Hi,

    To check if your logic is correct, use:

    GraphOnPrice ShortBreakEven

    GraphOnPrice FullShortExit

    GraphOnPrice PositionPrice

    Graph ShortStopSignal

    Etc.

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

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