Reducing tradesize after Xpoints from entry

Forums ProRealTime English forum ProOrder support Reducing tradesize after Xpoints from entry

Viewing 7 posts - 1 through 7 (of 7 total)
  • #115181

    Hi All,

    I am trying to code a reduction of the tradesize by half when being long/short and the current high/low reaches 20(before 15:00hr) or 40 (after 15:00hr) points. The remaining half will stay in until price closes below/above the lowest/highest point of the last 12 candlesticks. If the required points aren’t reached, but it does close on or above 10 points I want the stop loss to move to break even.

    Additionally, I always want to exit when price closes below/above the lowest/highest point of the last 12 candlesticks or at a loss of 15 points. Whichever is sooner.

    So far, I have come up with this, but it’s a mess:

    I would appreciate some help.

    Thanks

    #115182

    Are you aware that currently it is not possible to partially close a position using ProOrder when live trading? It is possible to test with partial closure when running a back test but you cannot put that strategy live in either demo or real trading.

     

    #115197

    Oh, that’s unfortunate. I have removed that part from the code and replaced it with just a profit target. However, it still doesn’t always do what I want it to do. That is exiting when price closes above or below the highest or lowest price of the last 12 candlesticks and moving the stop loss to break even after closing 10 points or higher from the entry price. Do you have any tips?

     

    #115200

    SET STOP PLOSS requires a distance and not a price.

    Try this (not tested):

     

     

    #115223

    This immediately exits my position, I just want to move the stop loss to break even. However, on your advice that set stop ploss requires a distance I changed tradeprice with just 0.1 that seems to work. It doesn’t work with 0 for some reason though. Anyway, thanks for your help.

    #115243

    SET STOP LOSS 0 cancels the stop order.

    When trying to code break even stop losses you have to be aware of how close to price your broker will let you place the stop – and this can change at times of high volatility. So if you are only a few pips in profit and try to move your stop to break even then it is likely that your broker will reject the order – if your strategy tries too many candles in a row then they will stop the strategy and either close the trade or orphan it depending on your settings.

    #115264

    Ok, I’ll keep that in mind. Thank you

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

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