gfxParticipant
Average
Hello all,
I just added a second trading system to my IG PRT account.
I wanted to keep both systems independant to avoid over coding or facing issues that I would not have keeping them appart.
But, I noticed that once the first one was in position, any triggered order from the second one would be rejected by IG ( which I understand due to margin requirement).
Thing is that once the order is rejected, the trading system which triggered the order it is stopped by IG.
Have you already faced this issue ? Is there any work around ?
thks.
Gfx
If it’s margin related, then it’s an issue you only can work out by funding your account.
If it’s on your Demo Account then you can easily increase Capital by adding more virtual money up to £10m.
Or reduce your contract size / exposure on each of your strategy, if possible.
gfxParticipant
Average
ok thks. So I understand that there is no work around to having both systems in a single one and to manage dual triggers.
Having two accounts, one for each, or allocating 50% of account size to each will definitively reduce the profits.
Indeed, most of the time, they are not supposed to open trade at the same time.
Thks for helping.
You can of course, compile the 2 strategies into a single one. You’ll have to set the required conditions to only trade one strategy at a time.
Sorry, the link seems not to work.
Here is a copy of my post.
You can assembly all of your strategies into a bigger file.
“DEFPARAM CumulateOrders = false” will do the hard job!
Of course you may need to name variables in different ways, say, a1s1 or cond1s1 for the first strategy, then a2s1/cond2s1….. a1s2/cond1s2 for the second strategy etc….
You may name a variable StrategyID = 0 when NOT ONMARKET, then set it to any number you want each buy/sell is executed so you know which strategy was triggered.
Example:
DEFPARAM CumulateOrders = False //Only 1 trade at a time
IF NOT OnMarket THEN //Make sure you reset this variable to ZERO when not trading
StrategyID = 0
ENDIF
//-----------------------------------------------------------------------------------------------------------------
IF (StrategyID = 0) OR (StrategyID = 1) THEN //Strategy 1
s1.... = ......
.
.
ENDIF
//-----------------------------------------------------------------------------------------------------------------
IF (StrategyID = 0) OR (StrategyID = 2) THEN //Strategy 2
s2Avg = Average[20](close)
s2Rsi = Rsi[14]
.
.
.
//************************************************************************
// LONG
//************************************************************************
IF close CROSSES OVER s2Avg THEN
StrategyID = 2
SET TARGET PPROFIT 20
SET STOP PLOSS 10
BUY nLots CONTRACT AT MARKET
ENDIF
//************************************************************************
// SHORT
//************************************************************************
IF close CROSSES UNDER s2Avg THEN
StrategyID = 2
SET TARGET PPROFIT 20
SET STOP PLOSS 10
SELLSHORT nLots CONTRACT AT MARKET
ENDIF
.
.
.
.
ENDIF
//-----------------------------------------------------------------------------------------------------------------
IF (StrategyID = 0) OR (StrategyID = 3) THEN //Strategy 3
s3.... = ......
.
.
.
ENDIF
gfxParticipant
Average
Thks for the framework. DEFPARAM CumulateOrders = True shall still be ok if I use the StrategyId variable. Correct ? Indeed, one strategy requires scaling in with is not possible if I set DEFP to False.
Won’t StrategyId be reset at each candle ? I remember that there was an issue with PRT as far as keeping value persistent in variables.
Yes with DEFPARAM = True, you can decide to accumulate positions or not with (NOT) ON MARKET.
As to variables, use different names for each strategy, but for StrategyID.
You can even set different trading and closing hours for each strategy.
Whatever you want to make common to ALL strategies needs to be written outside them.