only one trade per day on 3 strategies
Forums › ProRealTime English forum › ProRealTime platform support › only one trade per day on 3 strategies
- This topic has 59 replies, 6 voices, and was last updated 7 years ago by Andy11.
-
-
11/04/2016 at 2:43 PM #1597611/04/2016 at 5:08 PM #1598111/04/2016 at 7:00 PM #15983
attached 3 strategies on dax mini
1.1234567891011121314DEFPARAM CumulateOrders = False //defparam flatbefore=080000defparam flatafter=173000MyRSI = RSI[14](close)MyBollingerDown = BollingerDown [25](close)IF MyRSI <24 AND close < MyBollingerDown thenbuy 10 CONTRACT AT MARKETENDIF// Stops und TargetsSET STOP pLOSS 12set target pprofit 42.
1234567891011121314DEFPARAM CumulateOrders = Falsedefparam flatbefore=090000defparam flatafter=173000// Bedingungen zum Einstieg in Long-Positionenindicator1 = MACDline[12,26,9](close)c1 = (indicator1 CROSSES under -7)IF c1 THENBUY 5 CONTRACT AT MARKETENDIF// Stops und Targetsset target pprofit 103.
123456789101112131415DEFPARAM CumulateOrders = False //defparam flatbefore=080000defparam flatafter=173000// Bedingungen zum Einstieg in Long-Positionenindicator1 = RSI[14](close)c1 = (indicator1 < 20)IF c1 THENBUY 6 CONTRACT AT MARKETENDIF// Stops und TargetsSET STOP pLOSS 20set target pprofit 5these are 3 single strategies where i only like to have max 3 execution the day
thx for your support11/05/2016 at 10:58 AM #15987Could you try this template. I got this from Pro Real Time them selves a few months ago. Sorry I have no time to test until tomorrow. If this doesn’t work there is another idea. You didn’t mention what time frame(s) you are testing on.
P.S >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
1234567891011121314Once nbTrades = 0Once tradesPerDay = 1If Day<>Day[1] thennbTrades = 0ElseIf (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) thennbTrades = nbTrades + 1EndifEndifIf nbTrades < tradesPerDay then// Paste your code here and test, keep any DEFPARAM at the top stillEndif11/05/2016 at 3:25 PM #1600211/05/2016 at 5:33 PM #16013No difference at all? What time frame are you using?
Try this, taken from some code by @sylvess
1234567891011121314151617DEFPARAM CumulateOrders = Falsedefparam flatbefore=080000defparam flatafter=173000Once LastTradeDate = 0MyRSI = RSI[14](close)MyBollingerDown = BollingerDown [25](close)IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate thenbuy 10 CONTRACT AT MARKETLastTradeDate = OpenDateENDIF// Stops und TargetsSET STOP pLOSS 12set target pprofit 4111/06/2016 at 4:26 PM #1603911/07/2016 at 10:23 AM #16059one more question to my aim having only one trade per strategie
attached the programm, what do i have to add , if i like to have only one trade per day :
123456789101112131415DEFPARAM CumulateOrders = False //defparam flatbefore=080000defparam flatafter=173000// Bedingungen zum Einstieg in Long-Positionenindicator1 = RSI[14](close)c1 = (indicator1 < 20)IF c1 THENBUY 6 CONTRACT AT MARKETENDIF// Stops und TargetsSET STOP pLOSS 20set target pprofit 511/07/2016 at 8:49 PM #1612211/08/2016 at 9:50 AM #1614211/08/2016 at 9:54 AM #1614511/08/2016 at 12:39 PM #1615811/08/2016 at 1:03 PM #16160hi cosmic , your code is not correct …i have put in like you said …but programm shows more than one executions mid october … i believe on the 18oct
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950Once nbTrades = 0Once tradesPerDay = 1If Day<>Day[1] thennbTrades = 0ElseIf (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) thennbTrades = nbTrades + 1EndifEndifIf nbTrades < tradesPerDay thenDEFPARAM CumulateOrders = False //defparam flatbefore=080000defparam flatafter=173000// Bedingungen zum Einstieg in Long-Positionenindicator1 = RSI[14](close)c1 = (indicator1 < 20)IF c1 THENBUY 6 CONTRACT AT MARKETENDIF// Stops und TargetsSET STOP pLOSS 20set target pprofit 5endif11/08/2016 at 2:42 PM #16168I think this logic / example will serve you better.
1234567891011121314151617DEFPARAM CumulateOrders = Falsedefparam flatbefore=080000defparam flatafter=173000Once LastTradeDate = 0MyRSI = RSI[14](close)MyBollingerDown = BollingerDown [25](close)IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate thenbuy 10 CONTRACT AT MARKETLastTradeDate = OpenDateENDIF// Stops und TargetsSET STOP pLOSS 12set target pprofit 411/08/2016 at 3:35 PM #16180hi , thats on bollinger ….but how does it have to look like on the
above mentioned rsi stuff
1234567891011121314151617181920212223242526<span class="token keyword">DEFPARAM</span> <span class="token keyword">CumulateOrders</span> <span class="token operator">=</span> False <span class="token comment" spellcheck="true">//</span><span class="token keyword">defparam</span> <span class="token keyword">flatbefore</span><span class="token operator">=</span><span class="token number">080000</span><span class="token keyword">defparam</span> <span class="token keyword">flatafter</span><span class="token operator">=</span><span class="token number">173000</span><span class="token comment" spellcheck="true">// Bedingungen zum Einstieg in Long-Positionen</span>indicator1 <span class="token operator">=</span> <span class="token indicators">RSI</span><span class="token punctuation">[</span><span class="token number">14</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span>c1 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator1 <span class="token operator"><</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c1 <span class="token keyword">THEN</span><span class="token keyword">BUY</span> <span class="token number">6</span> <span class="token keyword">CONTRACT</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span><span class="token comment" spellcheck="true">// Stops und Targets</span><span class="token keyword">SET STOP</span> <span class="token keyword">pLOSS</span> <span class="token number">20</span><span class="token keyword">set target</span> <span class="token keyword">pprofit</span> <span class="token number">5</span>1234567891011121314151617181920212223242526272829<span class="token comment" spellcheck="true"></span>indicator1 <span class="token operator">=</span> <span class="token indicators">RSI</span><span class="token punctuation">[</span><span class="token number">14</span><span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token keyword">close</span><span class="token punctuation">)</span>c1 <span class="token operator">=</span> <span class="token punctuation">(</span>indicator1 <span class="token operator"><</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token keyword">IF</span> c1 <span class="token keyword">THEN</span><span class="token keyword">BUY</span> <span class="token number">6</span> <span class="token keyword">CONTRACT</span> <span class="token keyword">AT</span> <span class="token keyword">MARKET</span><span class="token keyword">ENDIF</span><span class="token comment" spellcheck="true">// Stops und Targets</span><span class="token keyword">SET STOP</span> <span class="token keyword">pLOSS</span> <span class="token number">20</span><span class="token keyword">set target</span> <span class="token keyword">pprofit</span> <span class="token number">5</span> -
AuthorPosts
Find exclusive trading pro-tools on