Can we use different Stop Loss and/or targets for different positions

Forums ProRealTime English forum ProOrder support Can we use different Stop Loss and/or targets for different positions

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

    Dear All,

    I was wondering whether we can attach different stop loss and targets to individual positions.

    I’ve tried with the code attached and also using SET STOP and SET TARGET but proOrder uses the latest stop/limit condition for all the open positions.

    Thank you,

    Renzo

    #131846

    The answer is yes and no. PRT can handle partial position closure at different levels by using STOP and LIMIT orders but IG do not allow partial position closure via automated strategies so at the moment we can only do it in back tests and running a strategy live with real money or in demo is not possible.

    https://www.prorealcode.com/documentation/stop-pending/

    https://www.prorealcode.com/documentation/limit/

     

     

    #131848

    Thank You Vonasi,

    I actually don’t want to close partial positions.

    I would like to open a position with its own stop and limit and while still live open a new position with different stop and limit.

    I understand that PRT applies the latest stop and limit to all the open positions. I would like to know whether there is a workaround.

    Thanks

    #131850

    I actually don’t want to close partial positions.

    I would like to open a position with its own stop and limit and while still live open a new position with different stop and limit.

    You just described adding to a position and then partial closure of that combined position so you do want partial closure.

    If you use SET STOP and SET TARGET instructions then whatever distance you choose will be applied to all opened positions from their entry price – so yes they will all have different closing prices but they cannot have different distances. You can do this in live trading.

    If you use pending STOP and LIMIT orders then you can set orders at whatever price you like but you cannot use this in live trading unless you close all positions at the chosen price. In back testing you can close part of your combined position – but only in backtest.

    #131903

    Hi Vonasi,

    I understand what you mean now.

    Though, I’ve tried wit the code attached and it keep changing all the orders (limi and stop) to the latest values of my ProfitTarget and StopLoss.

    Thank you for your kind help,

    Renzo

     

     

    #131904

    Sorry Vonasi,

    I had some code I forgot to erase.

    Have a great Sunday.

    #131907

    When using pending STOP and LIMIT orders you must make sure that they are placed at every bar because they only last for one bar. In your code they are only placed at the entry bar.

    Also unlike SET STOP and SET TARGET orders they require a price and not a distance.

    We have to also consider that at the time we place our buy order we do not know the exact price that it will get filled at but after one bar we do.

    If you want to control different positions with different levels then you will need different stop loss and take profit variables for each position. I haven’t ever bothered to code something like that because we can’t use it in real life because IG consider two positions of 1 to be one position of 2 and won’t let us close half of it using pending orders.

     

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