Need help to code second entry with same stoploss level

Forums ProRealTime English forum ProOrder support Need help to code second entry with same stoploss level

Viewing 8 posts - 1 through 8 (of 8 total)
  • #178264

    Good morning

    I need help to code an second entry after the first position is “x”  points in minus. The sl of the second position must be the same as that of the first position.

    For example:

    1. position: SL 200

    2. position: entry at -150 / sl -50

     

    Could anybody help?

    #178266
    JS
    #178267
    JS

    Not “End” but “EndIf” (last line)

    #178276

    Bear in mind that the stop loss is NOT separate for each position entered. It is calculated on PositionPrice (the average price). So there will only be ONE stop loss. If it’s hit, the first position entered will lose more than 200 pips and the second one will lose less than 200 pips. In the end you will suffer a 200-pip loss, anyway.

     

     

    #178281

    @JS

    Thank you very much.

    @robertogozzi

    Thats true. In case of SL, i will catch the first entry with SL 200 and the second entry with SL 50. In total 250 SL

    #178286

    is this correct?

    As far as I know,
    the buy order is executed at the start of the next candle. So TradePrice is not updated yet.

    #178290

    Pls find attached two backtests. Left side is the origin one, right side ist the version with the second entry. But something went wrong. I dont see the second entrys in the orderlist and SL is to high.

    #178294

    Thats true. In case of SL, i will catch the first entry with SL 200 and the second entry with SL 50. In total 250 SL

    Not exactly, it’s always 200 pips from POSITIONPRICE (the average price, see also my pic). Example:

    • first LONG      entry at 15600  – PositionPrice = 15600)                                    (initial SL    at 15400) – if hit, the position will lose 200 pips (200 pips per position)
    • second LONG entry at 15520  – PositionPrice = 15560,(15600+15520)/2)  (updated SL at 15360) – if hit, the 1st position will lose 240 pips, while the 2nd position will lose 160 pips (so it’s 200 pips per position)

     

     

     

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

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