STOPLOSS STUCK AFTER BEING SET

Forums ProRealTime English forum ProOrder support STOPLOSS STUCK AFTER BEING SET

Viewing 12 posts - 1 through 12 (of 12 total)
  • #71038

    I wrote this code below.

    When a certain price level is reached I want to move the stop loss to the entry price. but once it is set trying to set it again does not work.

    I saw that the code is reached but has no effect.

    any advise would be highly appreciated

     

     

    #71092

    I think the problem could be changing a stop loss when a buy/sell is already active.

    how can this be done?

    is there a workaround with trailing stop or other thoughts?

    #71094

    There are 2 solutions for u, search for the “breakeven” stop loss + the MFE trailing stop loss on this forum.

    Breakeven stop loss is self explanatory

    The MFE trailing waits for price to close over a certain amount of pips and then start trailing with XX trailing stop.

    1 user thanked author for this post.
    #71099

    yes that is exactly what I was looking for thanks!

    Now I realize that instead of setting a new stoploss I need to set a SELL/SHORTSELL instead.

    Good to know

    Thanks

    #71117

    Hi here is an example

    It uses % instead of points.

     

     

    1 user thanked author for this post.
    #71132

    Even after this change I don’t think my code works as expected. Looking at the charts I don’t see it exit when the “break even” price is reached.

    Here is the part of the code that deals with “on market” case. what do you think?

    the state is reached (state 13 and 14 in this example)

     

    #71137

    Did u try the breakeven code from forum?

     

    Copy pastaed the example with the breakeven code in it..

     

    1 user thanked author for this post.
    #71145

    Thanks

    I used a similar code as I wrote above and specifically added this:

    SELL AT POSITIONPRICE STOP

    following the forum code you mentioned.

    it seems to have not made a change in the charts though. If I put a breakeven of 100 pts or 40 pts the gains don’t change even though they should have

    So it is either a problem with my code or a problem with the detailed report in ProRealCode (I am guessing it’s my code but I don’t know what the problem is)…

     

    #71156

     

     

    Can u try to add this exact code at the bottom and check ur detailed report?

    As soon as profit > 30 pips (on a closed candle, not the high of the candle), this should close your trade at the least 5 pips in profit (without calculating spread and cost ofc.)

    #107834

    how to make this code for the short market???

     

    #107836

    @frenqle

    For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part!
    Thank you!

     

    #107838

    This is the code (you could have found it already coded, with a slightly different approach, at https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/):

     

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

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