linking 2 or more trading systems
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › linking 2 or more trading systems
hi,
is there a way i can link 2 or more systems trading the same instrument. example:
trading system 1
1 2 3 |
if not onmarket then buy 2 contract at market endif |
trading system 2
1 2 3 |
if longonmarket then sellshort 1 contract at market endif |
the trading system 2 cannot detect if there a longs on the market.
I’m afraid that link doesn’t work, that’s a copy of that 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
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 |
Find exclusive trading pro-tools on