Automatic system stop
Forums › ProRealTime English forum › General trading discussions › Automatic system stop
- This topic has 10 replies, 2 voices, and was last updated 2 years ago by robertogozzi.
-
-
08/24/2022 at 9:33 PM #199545
Hey, I need help! My system stops on every candle close and I don’t know what the problem is, maybe you can find what is causing the error, thanks!
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM Preloadbars = 10000// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 150000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 230000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0timeframe(4 hours,updateonclose)MA200 = average[200]MA50 = average [50]bulltrend = MA200<MA50//"default" timeframe (the timeframe you will launch the strategy on)timeframe(default)// Conditions to enter long positionsindicator1 = RSI[9](close)c1 = (indicator1 < 33)indicator2 = Stochastic[14,3](close)c2 = (indicator2 < 20)indicator3 = Average[3000](close)indicator4 = Average[750](close)c3 = (indicator3 <= indicator4)indicator5 = Average[250](close)indicator6 = Average[3000](close)c4 = (indicator5 > indicator6)c5 = (close <= DHigh(1))IF (c1 AND c2 AND c3 AND c4 AND c5) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND bulltrend THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to exit long positionsindicator7 = RSI[9](close)c6 = (indicator7 >= 79)indicator8 = Stochastic[14,3](close)c7 = (indicator8 >= 80)indicator9 = Stochastic[14,3](close)indicator10 = Average[4](Stochastic[14,3](close))c8 = (indicator9 > indicator10)indicator11 = Average[4](Stochastic[14,3](close))c9 = (indicator11 >= 80)IF c6 AND c7 AND c8 AND c9 THENSELL AT MARKETENDIF// Stops and targetsSET STOP pLOSS 6008/24/2022 at 9:41 PM #199547You set the conditions to exit at lines 43-51, if they are met then at line 54 your trade wikk be exited.
Are they correct?
When do you want to exit?
08/24/2022 at 9:46 PM #19955008/25/2022 at 8:40 AM #199557Which is the default timeframe you are using?
08/25/2022 at 8:45 AM #19955908/25/2022 at 11:13 AM #199588I started your strategy on DAX €5, 5-minute TF and it’s been running smoothly since a few bars (no trade has been opened so far).
I will keep it running a few more hours, though.
08/25/2022 at 11:52 AM #19959408/25/2022 at 11:53 AM #19959508/25/2022 at 1:22 PM #199601Yes, you can have multiple strategies running on the same instrument.
08/25/2022 at 3:47 PM #19962311/01/2022 at 10:09 AM #203346After such a long time a couple of trades were opened, then closed, with no errors.
-
AuthorPosts
Find exclusive trading pro-tools on