Does this system have an edge or is it just the last year?
Forums › ProRealTime English forum › ProBuilder support › Does this system have an edge or is it just the last year?
- This topic has 35 replies, 5 voices, and was last updated 7 years ago by victormork.
-
-
03/23/2017 at 2:18 PM #29612
I created this basic beginner code for the EURUSD 1H and added a trailing stop function which Nicolas had posted on the forum. The result looks okay but my concern is that it’s starting first after 2015 (1 pip spread). Any takes on what I could do differnet. And how is the performance before 2013? Short trades has been far more profitable than long trades during the backtest. Maybe not a surprise since the longer trend has been to the downside.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = CCI[8]c1 = (indicator1 CROSSES OVER -240)indicator2 = BollingerBandWidth[20](close)c2 = (indicator2 > 0.003)indicator3 = TRIX[12](close)indicator4 = Average[9](indicator3)c3 = (indicator3 > indicator4)IF (c1 AND c2 AND c3) AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator7 = CCI[8]c5 = (indicator7 CROSSES UNDER 140)indicator8 = BollingerBandWidth[20](close)c6 = (indicator8 > 0.003)indicator9 = Average[9](TRIX[12](close))indicator10 = TRIX[12](close)c7 = (indicator9 > indicator10)IF (c5 AND c6 AND c7) AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// StoplossSET STOP pLOSS 55trailingstart = 50 //trailing will start @trailinstart points profittrailingstep = 5 //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF03/27/2017 at 12:31 PM #29955C1 should be changed to cross over -150 in order to include long trades too.
03/27/2017 at 1:17 PM #29968Looks good Victor, I like the low Drawdown!
I’ve always found EUR/USD difficult to trade manual or Auto, but you seem to have nailed it!
Have you got Walk Forward test on your Platform yet? Interesting how your Bot works on Walk Forward.
I’ll come back with any improvements, but somehow I don’t think I’ll find any! 🙂
Cheers
GraHal03/27/2017 at 1:49 PM #2997803/27/2017 at 6:39 PM #30034Finally a reply! I thought it was a bit strange that no one reacted on what I thought was a pretty good attempt on this pair. Can you please tell me a bit more about the idea behind your loss limiter? It looks very interesting!
I got the Walk Forward test available on my demo account today so I have not yet had time to try it out on this system. I’m currently testing the system on my demo account and hopefully I’ll take it live afterwards.
03/27/2017 at 7:10 PM #30047Since you are “mirroring” the conditions for short trades, is it normal that indicator9 and indicator10 variables are different than the long ones?
You should also only declare the same indicator only once, it is unnecessary to declare them for each side.
03/27/2017 at 7:13 PM #30048Yes it can be disappointing when nobody replies, I experience this also. I noticed it had been a few days with no response so I thought I’d check it out.
Normally I’m very cautious and run on Demo first, but with my loss limiter coded in for added negative equity protection, I thought I’d set it going Live @ £1 per point.
If you want to know more re the Loss Limiter then please read below. Loads of background reading also on the ‘bad beginnings’ thread (3rd line of link below).
https://www.prorealcode.com/topic/negative-equity-loss-limiter-help-please/
I’ll let you know when your Bot triggers in Live for me.
Regards
GraHal03/28/2017 at 7:55 AM #30063@Nicolas – when I mirror the conditions for long and short I normally have the long a bit lower and the short a bit higher for a better result. In this case there’s an error in the buying condition as I pointed out later on. It should be “cross over -150” (almost the same as cross under 140) and not -240.
@GraHal – Thanks for the link, I’ll check it out! The draw down visible on the picture I uploaded is smoothen out with the correct buying condition so I’m hoping that the real test will be okay. Let’s have a review after a few trades.
03/29/2017 at 10:44 AM #30198Triggered … see short trade attached.
I’m probably going to stop the Bot if it goes back up much past the LH at 10,794 (IG times by 10K so 1.0794) as this would indicate a reversal of the current downtrend.
It be interesting to see what your Bot does in Demo?
GraHal
03/29/2017 at 5:05 PM #30226I’m short too on my demo and I’ll let it run to see how the exit is handled. If you are stopping now I can congratulate you to 60 pips 🙂
03/29/2017 at 7:16 PM #3023803/29/2017 at 8:41 PM #3023903/29/2017 at 9:02 PM #3024103/30/2017 at 8:26 AM #30264Hi Nicolas, Yes the long trades was solved buy updating the entry criteria.
The system closed the position on 1.07708 (about 45 pips profit) and has now opened a new short. You can put the code in the library but I’m afraid I don’t have time at the moment to rewrite it more nicely were every indicator is specified only once. I have attached the correct code and I have updated this one with an additional criteria on
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = CCI[8]c1 = (indicator1 CROSSES OVER -150)indicator2 = BollingerBandWidth[20](close)c2 = (indicator2 > 0.003)indicator3 = TRIX[12](close)indicator4 = Average[9](indicator3)c3 = (indicator3 > indicator4)indicator5 = TRIX[15](close)c4 = (indicator5 < 0.015)IF (c1 AND c2 AND c3 AND c4) AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator7 = CCI[8]c5 = (indicator7 CROSSES UNDER 140)indicator8 = BollingerBandWidth[20](close)c6 = (indicator8 > 0.003)indicator9 = Average[9](TRIX[12](close))indicator10 = TRIX[12](close)c7 = (indicator9 > indicator10)c8 = (indicator5 > -0.015)IF (c5 AND c6 AND c7 AND c8) AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// StoplossSET STOP pLOSS 55trailingstart = 50 //trailing will start @trailinstart points profittrailingstep = 5 //trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFboth long and short which prevents from entering positions following the shorter trend when the price is in an oversold or overbought stage. This only excluded 10 trades out of 400+ so I think it’s acceptable.
03/30/2017 at 10:15 AM #30289 -
AuthorPosts
Find exclusive trading pro-tools on