IG & Trailing Stops

Forums ProRealTime English forum ProOrder support IG & Trailing Stops

  • This topic has 8 replies, 4 voices, and was last updated 6 days ago by avatarJS.
Viewing 9 posts - 1 through 9 (of 9 total)
  • #244661

    I’m using a simple “SET STOP TRAILING 60” in my code but when the order executes, if I look on the IG platform, it’s not showing a stop in place. My assumption was that the stop should be in place with the order, or is PRT managing the stop for me?

    If the order should be being placed with a stop, what am I doing wrong?

    #244662

    I should add: the code works fine during a backtest with the stops working as expected, it’s only when I auto trade with IG that the “problem” occurs.

    #244666

    Hi!

    Your assumption is correct: when using SET STOP TRAILING 60, the trailing stop should be placed along with the order. However, if you are using an account with Limited Risk (which is the default for IG accounts opened through ProRealTime), you can only use Guaranteed Stops and not Trailing Stops.

    To be able to use regular or Trailing Stops, you would need to contact IG directly and request a change in your account type. IG typically refers to these as Professional Accounts, which allow more flexibility in stop types.

    Alternatively, if you want to manually program a trailing stop, you can code it yourself in ProBuilder instead of using the built-in SET STOP TRAILING.

    #244668

    Thanks Ivan. I’m able to place trades with a trailing loss manually with IG, so I don’t think I’m on a Limited Risk account.

    #244669

    My code is:

    IF ConditionsToBuy THEN

    BUY 1 CONTRACTS AT MARKET

    SET STOP TRAILING 60

    ENDIF

    Is there anything wrong with that?

     

    #244673

    It be worth trying  – SET STOP pTRAILING 60 – to see if it makes any difference?

    #244676

    So, I’ve figured it out, sort of.

    If I use SET STOP TRAILING 60 it does actually work. What I’m actually doing is trying to pass a variable:

    trailingPercent = 0.5

    trailingPoints = tradeprice(1)*(trailingPercent/100)

    SET STOP TRAILING trailingPoints

    This works fine in a backtest but clearly the value of trailingPoints isn’t being passed to IG correctly. I tried doing it this way because PRT specifically tells me that IG doesn’t support SET STOP %TRAILING so  trying to build my own version.

    I’ve had a look at some of the suggested alternatives to setting a stop loss but can’t make them work on the actual IG platform the same way as either SET STOP %TRAILING or my fake version does during a backtest.

    #244679

    What Instrument are you running as – unless an Index – then you need

    SET STOP TRAILING trailingPoints*pipsize

    #244684
    JS

    First, I want to say that, in my case, all the different (IG) “trailing stops” work in automatic and manual trading…

    If you do what you mentioned in your last message, namely make the trailing stop dependent on the “TradePrice(1)” then this will never work because the order must first be executed to determine the value of the “TradePrice(1)”…

    What you can possibly try, if you want to do it this way, is to remove the trailing stop from the “If-statement”…

    IF ConditionsToBuy THEN

    BUY 1 CONTRACTS AT MARKET

    ENDIF

    TrailingPoints=TradePrice(1)*(TrailingPercent/100)

    Set Stop Trailing TrailingPoints

    1 user thanked author for this post.
Viewing 9 posts - 1 through 9 (of 9 total)

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