set stoploss from tradeprice to the lowest of 5 candles plus spread

Forums ProRealTime English forum ProOrder support set stoploss from tradeprice to the lowest of 5 candles plus spread

Viewing 6 posts - 1 through 6 (of 6 total)
  • #162911

    hi,

    i am trying to add a stop loss when going long when the candle crosses the 200ma. the stop loss is meant to be under the lowest of the last 5 candles when i have gone long. somehow it is not placing any stop loss.

     

    #162912

    Replace TRADEPRICE with CLOSE in line 11, since it takes a whole candle for it to be known. Using CLOSE may not exactly the same, due to slippage (if any), but it’s thfe only known entry price at that moment. TRADEPRICE is either 0 (if it’s the first trade) or the exit price of the prior trade.

    Next candle, if you want to be more accurate, you can recalculate your SL. But this is usually not necessary.

     

    #162913

    i changed the tradeprice to close and whenever i open a position it is closing immediately

    #162914

    longstoploss is always zero but when i check the individual values of close, and lowest[5](low) and do the math myself, its not equal to zero.

    #162915

    i solve it. line 11 replace with

    it was pipsize command. i thought it converts the number in the bracket to pips.

    #162918

    Yes, you are right. You have to divide by PipSize:

     

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

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