ProRealTIme not respecting stop loss

Forums ProRealTime English forum ProOrder support ProRealTIme not respecting stop loss

Viewing 15 posts - 1 through 15 (of 15 total)
  • #64405

    Hi all.

    I had Nicolas code my strategy that all seemed to work fine in forward testing but not so trading live. An FX trade closed today at 3.5x the expected stop loss distance when it should have been only 0.6*ATR(24). The code for the part of the strategy is given below:

    In this instance the trade opened live but instead of closing at the stop loss (which was 0.6*ATR[24] or 18 pips) it didn’t close until 62 pips later, which resulted in a much bigger than expected loss? Any ideas please?

    Grim

    #64414

    The ‘ATR’ variable is not defined anywhere in the code, so StopLoss = 0.5*ATR = 0.5*0 = 0

    Wrong copy/paste?

    #64422

    Hi Nicolas

    Thanks – the ATR is defined earlier in the code as atr=averagetruerange[24] but I didn’t want to paste the whole code as I had to pay you to produce it 😉

    I backtested the system this morning in demo mode and it produced the correct stop loss. For some reason in the live trading it didn’t work and closed at near double the ATR instead of x0.6 ATR??

    #64428

    Just a thought and I’m sure you haven’t got it wrong … but are you running it on the correct / intended TimeFrame that the Algo is optimised for??

    I have done that before … set one going and later realised I must have flicked to another TF??

    #64431

    could it be some big temporary  spike in price?

    #64432

    Hi Guys – thanks for the replies.

    Yes on the correct TF (H1) and there was no spike. Oddly it was in a much deeper loss during the 0800-0900 time but it seemed to close out when the H1 bar closed at 0900.

    #64434

    Don’t you need

    Not

     

    #64459

    Please give more details about the trade: pair, open time, closed time, price entry, stoploss value, etc..

    #64467

    Hi Nicolas

     

    EurJpy. Opened at 0800 at 12946 at £6 per pip. ATR was 31 at time so SL should have been 0.6*ATR[24] making 18. Actual trade closed out at 0900 at 13008. Should have only been £108 loss (18x£6) but actually closed with loss of £369 which was 62 pips (almost 2x ATR)

    #64494

    Hi GraHal

    I thought set stop ploss was for pips ie stoploss =10 for example. When using a multiple of ATR do you not drop the p from loss?

    Thanks

    #64519

    Mmm well I got confused ages ago re Set Stop Loss so I called IG and he said it is the units of currency in which the trade is executed??

     

    #64544

    set stop loss StopLoss is correct if we are using price units and not points/pips, and that’s the case with ATR.

    Did you look at your orders lists (CTRL+O) to see what happened at that time?

    #64611

    Ok thanks Nicolas. Still bemused as to why it didn’t activate at all. The other pairs with the same code work, just with EurJpy this is the 2nd time this has happened!

    #64627

    Hi Guys

     

    Is it possible in the code given above to close out partial positions? Could I set a target profit for 1*ATR for half the position and then ‘n’ ATR for the remaining half?

    With this strategy I have noted that if I target profit at say 1ATR the % of winning trades is higher, but of course the gain is much lower. It’s finding the right balance between setting a profit target far enough away to make the strategy profitable, but not so far away that it loses. Is there a more effective volatility based metric than using ATR perhaps?

    I’d be interested to see if closing x% of the position at x% target and leaving rest to run on a trailing ATR stop for example was more profitable? Any help appreciated!

    Best

    Grim

    #64633

    You can’t close partial positions, except with manual trading.

    How about running two Algos same code but with half lot size in each and then try your 1*ATR for half the position and then ‘n’ ATR for the other?

     

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

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