GBP/USD 15 min between 9:00-13:00
Forums › ProRealTime English forum › ProOrder support › GBP/USD 15 min between 9:00-13:00
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by
mansothzen.
-
-
09/28/2020 at 6:02 PM #145744
Hello
This is my first attempt at creating an automated strategy!
The idea of the strategy is to only take trades between 9:00-13:00 (London time). And to only take trades with the current trend.
I have been using a version of this when trading manually for the last couple of months.
I don’t know how to make the bot look at different time aspects,so this one is only made in 15 min.
When i trade it manually i take in consideration of the 200 MA on the daily and don’t take trades on the wrong side of the 200 MA, but i don’t know how to add that into the automated system.
It definitely needs some tweaking, maybe someone can make something good out if it!
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 090000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 130000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = Average[200](close)c1 = (close > indicator1)indicator2 = SAR[0.02,0.02,0.2]c2 = (close > indicator2)indicator3 = Average[100](close)c3 = (close > indicator3)indicator4 = Average[50](close)c4 = (close > indicator4)indicator5 = RSI[14](close)c5 = (indicator5 > 40)c6 = (close > DLow(0))IF (c1 AND c2 AND c3 AND c4 AND c5 AND c6) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator6 = Average[200](close)c7 = (close < indicator6)indicator7 = SAR[0.02,0.02,0.2]c8 = (close < indicator7)indicator8 = Average[100](close)c9 = (close < indicator8)indicator9 = Average[50](close)c10 = (close < indicator9)indicator10 = RSI[14](close)c11 = (indicator10 < 60)IF (c7 AND c8 AND c9 AND c10 AND c11) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Stops and targetsSET STOP pLOSS 30SET TARGET pPROFIT 6009/28/2020 at 6:38 PM #145749At line 27
1c12 = (close > average[200,0](close))and add C12 to your conditions at line 28
the reverse at line 43:
1c13 = (close < average[200,0](close))and add C13 to your conditions at line 44.
09/28/2020 at 6:51 PM #14575209/28/2020 at 7:11 PM #145758changed the SL TP and got a better return without any big changes to drawdown or time in market.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 090000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 130000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = Average[200](close)c1 = (close > indicator1)indicator2 = SAR[0.02,0.02,0.2]c2 = (close > indicator2)indicator3 = Average[50](close)c3 = (close > indicator3)indicator4 = Average[20](close)c4 = (close > indicator4)indicator5 = RSI[14](close)c5 = (indicator5 > 40)c6 = (close > DLow(0))c12 = (close > average[200,0](close))IF (c1 AND c2 AND c3 AND c4 AND c5 AND c6 and c12) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator6 = Average[200](close)c7 = (close < indicator6)indicator7 = SAR[0.02,0.02,0.2]c8 = (close < indicator7)indicator8 = Average[50](close)c9 = (close < indicator8)indicator9 = Average[20](close)c10 = (close < indicator9)indicator10 = RSI[14](close)c11 = (indicator10 < 40)c13 = (close < average[200,0](close))IF (c7 AND c8 AND c9 AND c10 AND c11 and c13) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Stops and targetsSET STOP pLOSS 30SET TARGET pPROFIT 7009/28/2020 at 8:29 PM #145773You could try adding a trailing stop.
For the trailing stop I suggest to use the code from lines 17 to 56 at this link https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/.
09/28/2020 at 9:30 PM #145778Thank you for the idea!
will try it and see if i can get drawdown down perhaps
-
AuthorPosts
Find exclusive trading pro-tools on