linking 2 or more trading systems
Forums › ProRealTime English forum › ProOrder support › linking 2 or more trading systems
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
-
-
02/17/2021 at 4:07 AM #161743
hi,
is there a way i can link 2 or more systems trading the same instrument. example:
trading system 1
123if not onmarket thenbuy 2 contract at marketendiftrading system 2
123if longonmarket thensellshort 1 contract at marketendifthe trading system 2 cannot detect if there a longs on the market.
02/17/2021 at 9:21 AM #16175602/17/2021 at 9:29 AM #161761I’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:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748DEFPARAM CumulateOrders = False //Only 1 trade at a timeIF NOT OnMarket THEN //Make sure you reset this variable to ZERO when not tradingStrategyID = 0ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 1) THEN //Strategy 1s1.... = ........ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 2) THEN //Strategy 2s2Avg = Average[20](close)s2Rsi = Rsi[14]...//************************************************************************// LONG//************************************************************************IF close CROSSES OVER s2Avg THENStrategyID = 2SET TARGET PPROFIT 20SET STOP PLOSS 10BUY nLots CONTRACT AT MARKETENDIF//************************************************************************// SHORT//************************************************************************IF close CROSSES UNDER s2Avg THENStrategyID = 2SET TARGET PPROFIT 20SET STOP PLOSS 10SELLSHORT nLots CONTRACT AT MARKETENDIF....ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 3) THEN //Strategy 3s3.... = .........ENDIF123456789101112131415161718192021222324252627282930313233343536373839404142434445464748DEFPARAM CumulateOrders = False //Only 1 trade at a timeIF NOT OnMarket THEN //Make sure you reset this variable to ZERO when not tradingStrategyID = 0ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 1) THEN //Strategy 1s1.... = ........ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 2) THEN //Strategy 2s2Avg = Average[20](close)s2Rsi = Rsi[14]...//************************************************************************// LONG//************************************************************************IF close CROSSES OVER s2Avg THENStrategyID = 2SET TARGET PPROFIT 20SET STOP PLOSS 10BUY nLots CONTRACT AT MARKETENDIF//************************************************************************// SHORT//************************************************************************IF close CROSSES UNDER s2Avg THENStrategyID = 2SET TARGET PPROFIT 20SET STOP PLOSS 10SELLSHORT nLots CONTRACT AT MARKETENDIF....ENDIF//-----------------------------------------------------------------------------------------------------------------IF (StrategyID = 0) OR (StrategyID = 3) THEN //Strategy 3s3.... = .........ENDIF -
AuthorPosts
Find exclusive trading pro-tools on