Make program take a pause after win
Forums › ProRealTime English forum › ProOrder support › Make program take a pause after win
- This topic has 6 replies, 2 voices, and was last updated 3 years ago by
Mr.Mjau.
-
-
07/21/2022 at 2:43 PM #197630
Hi all
Been playing around with ProRealtime for like 10w now and I have made some profits so far, but I have one problem that maybe someone can help me with.
If this is met
1SET TARGET pPROFIT 325The following trade is 90% a loss. Is there a way to make the program to take a pause/break for some time for ex 12/24/36h after it has hit the target profit?
Best wishes
Daniel
07/21/2022 at 2:55 PM #197631Yes, the best is pausing the strategy for N bars (you know how many bars it takes to pause 1, 4 or 48 hours).
Add the variable TradeON to your conditions to trade:
1234567891011121314ONCE TradeON = 1ONCE PauseBars = 20ONCE Count = 0IF TradeON = 0 THENCount = Count - 1TradeON = (Count = 0)ENDIFIF StrategyProfit > StrategyProfit[1] THENCount = PauseBarsTradeON = 0ENDIFIF MyLongConditions AND TradeON THENBUY.....ENDIF1 user thanked author for this post.
07/21/2022 at 3:13 PM #197632Hi Roberto and tank you for your fast reply
I have sofar just used the simplyfied creation, so all this is new to me. I post the full code and mb you can tell me where and how to make your code fit?
1234567891011121314151617181920212223// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Conditions to enter long positionsindicator1 = ExponentialAverage[20](close)indicator2 = ExponentialAverage[100](close)c1 = (indicator1 CROSSES OVER indicator2)IF c1 THENBUY 5 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator3 = ExponentialAverage[20](close)indicator4 = ExponentialAverage[100](close)c2 = (indicator3 CROSSES UNDER indicator4)IF c2 THENSELL AT MARKETENDIF// Stops and targetsSET TARGET pPROFIT 32507/21/2022 at 4:41 PM #197641There you go:
1234567891011121314151617181920212223242526272829303132333435// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedONCE TradeON = 1ONCE PauseBars = 20ONCE Count = 0IF TradeON = 0 THENCount = Count - 1TradeON = (Count = 0)ENDIFIF StrategyProfit > StrategyProfit[1] THENCount = PauseBarsTradeON = 0ENDIF// Conditions to enter long positionsindicator1 = ExponentialAverage[20](close)indicator2 = ExponentialAverage[100](close)c1 = (indicator1 CROSSES OVER indicator2)IF c1 AND TradeON THENBUY 5 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator3 = ExponentialAverage[20](close)indicator4 = ExponentialAverage[100](close)c2 = (indicator3 CROSSES UNDER indicator4)IF c2 AND TradeON THENSELL AT MARKETENDIF// Stops and targetsSET TARGET pPROFIT 3251 user thanked author for this post.
07/21/2022 at 5:45 PM #197645Tank you so much, I got it working and is now trying out different values and backtesting. But now it makes a pause after every winning trade, so both when “Condition to exit long position” makes a profit and “stops and targets” are met. Is there a way to make it only pause after the “Stops and target(set target pProfit(325))” is met?
07/22/2022 at 11:59 AM #197707There you go:
1234567891011121314151617181920212223242526272829303132333435363738// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedONCE TradeON = 1ONCE PauseBars = 20ONCE Count = 0ONCE PauseTrading = 1IF TradeON = 0 THENCount = Count - 1TradeON = (Count = 0)ENDIFIF StrategyProfit > StrategyProfit[1] AND PauseTrading THENCount = PauseBarsTradeON = 0ENDIF// Conditions to enter long positionsindicator1 = ExponentialAverage[20](close)indicator2 = ExponentialAverage[100](close)c1 = (indicator1 CROSSES OVER indicator2)IF c1 AND TradeON THENBUY 5 CONTRACT AT MARKETPauseTrading = 1ENDIF// Conditions to exit long positionsindicator3 = ExponentialAverage[20](close)indicator4 = ExponentialAverage[100](close)c2 = (indicator3 CROSSES UNDER indicator4)IF c2 AND TradeON THENSELL AT MARKETPauseTrading = 0ENDIF// Stops and targetsSET TARGET pPROFIT 3252 users thanked author for this post.
07/22/2022 at 12:40 PM #197712 -
AuthorPosts
Find exclusive trading pro-tools on