Silver gun Strategy NQ and ES 4 hours
Forums › ProRealTime English forum › ProOrder support › Silver gun Strategy NQ and ES 4 hours
- This topic has 9 replies, 3 voices, and was last updated 1 month ago by Anjuna Marine.
-
-
11/07/2024 at 2:49 PM #240069Silver Gun12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061//NQ 10-20-2.5-9-25-40-180-22//ES 10-8-1.5-7-25-40-38-20DEFPARAM CumulateOrders = falsePositionsize=1C1= Close>high[1]C2=Low<Low[1]C3=High-Low>=K2C5=(open-low)>=0.10*(high-low)If not ONMARKET and C1 and C2 and C3 and c4 and C5 and SS thenBuy positionsize contract at marketEndIfC4 =RSI[K7](close) > K6AGBARLong = AverageTrueRange[14](close)SS=AGBARLong =< NN//calcola differenza di prezzoStopLoss = abs(close - low[1])+K4SET STOP LOSS StopLoss*10 //setta lo SL in differenza di prezzoSET TARGET PROFIT StopLoss*K3//trailing stop functiontrailingstart = K5// RR 20trailing will start @trailinstart points profit-50trailingstep = 10// 5trailing step to move the "stoploss"//reset the stoploss valueIF NOT LONGONMARKET 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 STOPENDIF
Hello to everyone,
It’s a long time I don’t see someone sharing a strategy, maybe everyone is jealous of their own work. By the way I want to share this simple strategy on 4 hours timeframe, I use futures on IB; parameters are for Nasdaq, but they can be adapted for ES (parameters are on top of strategy).
actually I’m using other strategies but it looks promising.
please share your opinion how we can improve it, with some other filters. Filters are something that I have more difficulties to find and tune.
Alessio
3 users thanked author for this post.
11/07/2024 at 2:51 PM #24007011/07/2024 at 3:51 PM #24007611/07/2024 at 5:17 PM #24008211/08/2024 at 7:33 PM #240148Hey Aragorna, thanks for sharing this. I’ve had a play and tested the system with out-of-sample data and adjusted the optimisation for more practical results.
With a starting margin of £10,000 and using all of it for position sizing, I tested the original code on Jan 2018 to Nov 2024. This setup generated £72k in profit, with a max drawdown of -£20k. Every year since 2009 was profitable except for 2021, which saw a minor loss. It’s promising in back-testing, though I haven’t accounted for overnight funding costs yet.
To dig deeper, I checked performance from 2011 to 2017 (inclusive), and it incurred a £23.5k loss with spreads factored in, but excluding any overnight funding. This suggests possible overfitting. I noticed you left variable optimisations in the ITF file, so I’m re-optimising it on 2011-2017 data.
30 minutes later…
After re-optimising, the in-sample back test (2011-2017) shows a profit of £24k with a -£15k max drawdown. Gains are somewhat uneven, with £18k concentrated in 2009, and other years near break-even. Using these new optimised parameters, the system’s out-of-sample performance (2018 to date) gives us £22.5k in gains and a max drawdown of -£8.6k. The system maintained a relatively stable equity curve throughout the 2022 downturn, which can be a good sign for a long-only strategy.
While I haven’t conducted WF testing, or Monte Carlo simulations, these results suggest it’s not quite ready to trade solo. However, it could be valuable as part of a portfolio of uncorrelated systems, taking advantage of big bull runs. Would just have to calculate those overnight funding costs and see how that affects.
Hope this analysis sheds some light!
Be interesting to know exactly what the system is doing and your thoughts behind it. I tested and optimized without reading too much into the code.
1 user thanked author for this post.
11/09/2024 at 1:10 AM #24015411/09/2024 at 1:20 AM #240159and this missing file attached( Walk forward for ES) . parameters seem more than should be but in the end they are useful to tune for the instrument to be traded. K1 is not even used in strategy, I use it only for testing walk forward (if I don’t let a parameter on optimisation, I cannot use walk forward.
K2 is adapted to the typical lenght of push candles that are different from NQ to ES. then there are a couple of fitlers , RSI and ATr, for filter out some trades. It’s a strategy I wrote in 15 minutes, could be better than this.
The idea behind this strategy is that usually before a bullish run, there is a strong push that is caught by these conditions. But I’m not a big fun of 4 hours strategy, I prefer using 30 minutes and 1 hour in general.
11/09/2024 at 1:35 AM #240161ffor my little experience, I’ve seen a transformation of ES and NQ futures, like others futures, from 2020. I prefer to optimise and run strategies that work better in last four years and a little less better years before 2020 and this is confirmed by some strategies that I’m running from June that have behaved much better than I expected. In attachment I have the equities of 2 strategies I’m running Out of Samples from june on microNasdaq and MicroES, that (fingers crossed) I hope will behave in the future in a good way. I’d like to share here some ideas on how you create strategies and adapt on actual markets.
Alessio
11/09/2024 at 1:40 AM #24016311/09/2024 at 4:39 PM #240174I’m using IG on a UK Spread Betting account. The markets on this type of account are called US Tech 100 (DFB) and US 500 (DFB).
Thanks for the additional information and screenshots of your results. It’s interesting, I’ll take another look, this time at your ES version. I’ll use the same sizing as you have used and try to replicate the results.
I completely agree about placing less importance on older data. I guess I was trying to break the system or find its weakness and perhaps going back as far as 2009 was unfair to the system as it has less relevance. On the higher timeframes (daily) and when trading longer time horizons it can help to look back over 20 years, but for short term trades, recent data is going to be a better indication of how the markets are currently moving. I’ve found this to be particularly true about the NASDAQ and the DAX in recent years.
I’ll feedback again once I’ve had a fresh look, hopefully within the next few days.
-
AuthorPosts
Find exclusive trading pro-tools on