Strategy stop-loss

Forums ProRealTime English forum ProOrder support Strategy stop-loss

Viewing 5 posts - 1 through 5 (of 5 total)
  • #9387

    It appears that the code below only checks the strategy p&l once the current trade is stopped-out?

    Is that right?

    Very often, the marked-to-market p&l is less than the “stopout” level but the algo carries on trading until the current position is exited. It seems to be only then that it checks the strategy p&l. I would like it to check the p&l after every change in price and stop trading immediately the “stopout” level is hit. How is this written?

     

    Many thanks

     

    if StrategyProfit <= StopOut then
    QUIT
    endif

     

     

    #9388

    That’s right, STRATEGYPROFIT is updated with closed trades.

    You can use POSITIONPERF to know actual positions PnL.

    #9392

    So,

    strategyprofit + p&l from open positions = realtime p&l

    It seems POSITIONPERF is a ratio.

     

    What is the simplest way to convert this into a currency amount for an open position … positionperf*positionprice?

    Thanks

    #9393

    You can compute the floating profit with this function:

    and add it to STRATEGYPROFIT to get the whole account profit (closed trades + not closed ones).

     

    #9394

    Great – thank you Nicolas

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

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