DAX Parabolic System
Forums › ProRealTime English forum › ProOrder support › DAX Parabolic System
- This topic has 14 replies, 7 voices, and was last updated 3 years ago by monkeys nuts.
-
-
12/16/2019 at 4:02 PM #114991
Hi guys,
Let me show you this simple strategy using SAR. It use a simple SAR with two filters (stochastic and macd) to select better operations.
I have a lot of fake signals but anyway winners are better than lossers so it make money.
It works for DAX 1h.
Any idea to improve this strategy?
123456789101112131415161718192021222324252627282930313233343536373839404142// Definición de los parámetros del códigoDEFPARAM CumulateOrders = False // Acumulación de posiciones desactivada// Condiciones para entrada de posiciones largasparabolic = SAR[0.02,0.02,0.2]sto = Stochastic[5,3](close)signal = average[3](sto)mac = MACD[12,26,9](close)c1 = (parabolic < close)c2 = (signal > 50)c3 = (parabolic[1] > close[1])IF c1 AND c2 AND c3 and mac >0 THENBUY 1 CONTRACT AT MARKETENDIF// Condiciones de salida de posiciones largasc4 = (close < parabolic)IF c4 THENSELL AT MARKETENDIFc5 = (parabolic > close)c6 = (parabolic[1] < close[1])if not c2 and c5 and c6 and mac < 0 thenSellshort 1 contract at marketendifc7 = (close > parabolic)IF c7 THENEXITSHORT AT MARKETENDIFSET STOP pTRAILING 551 user thanked author for this post.
12/16/2019 at 7:14 PM #11499712/16/2019 at 7:17 PM #11500012/16/2019 at 7:24 PM #115003And using the TS code found at Log 65 here …
I get attached … better again! 🙂
1 user thanked author for this post.
12/16/2019 at 7:27 PM #11500712/16/2019 at 7:55 PM #115009With TS = 55, I get attached error message and the Strategy stopped at the red arrowheads.
You’ve unfortunately hit on a tick by tick data hole. I see this error quite often on the DJI daily when using tick by tick because there is a day sometime in 2010 that has data problems or no tick by tick and if a trade happens to be open on this day then the strategy crashes and gives me that error message.
1 user thanked author for this post.
12/16/2019 at 8:15 PM #11501005/06/2021 at 9:12 PM #16897905/06/2021 at 11:41 PM #168990What’s your question exactly, is it too good to be true or is it not as good as expected?
Did you include spread?
Did you use tick-by-tick mode?
How many lots/contracts did you trade each time?
Please post the ITF file you have used.
06/12/2021 at 6:17 PM #171658Hi, I’d improved this system with fix stop loss and take profit and Nicolas’s trailing stop. I add a condition that close trade on friday after time that I setted.
I attach file and images of equity and report. In my opinion we have to filter much better, because there are a lot of trade and we have to consider overnight costs (if someone expert coder can do that).
I backtested this system from 2010 to now with tick by tick mode with 2point spread.
06/12/2021 at 7:02 PM #17166211/25/2021 at 4:44 PM #182267I came across this in the library – thanks to AE for sharing.
Made a few changes, tweaked the numbers here and there, I’m sure there’s still room for improvement.
***Optimized on 100% of data so still needs out of sample testing***
No reason this shouldn’t be re-optimized for the NAS, SP etc.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186// 25/11/21DEFPARAM CumulateOrders = False // Acumulación de posiciones desactivadaDEFPARAM preloadbars = 10000positionsize=1Timeframe (4 hours)ma = average[p,t](typicalprice)cb1 = ma > ma[1]mb = average[p2,t2](typicalprice)cs1 = mb < mb[1]Timeframe (default)parabolic = SAR[q,w,e]parabolicS = SAR[qs,ws,es]sto = Stochastic[s1,s2](close)signal = average[av,t3](sto)mac = MACD[m,a,c](close)cb2 = (close > parabolic)cb3 = (close[1] < parabolic[1])cs2 = (close < parabolicS)cs3 = (close[1] > parabolicS[1])cb4 = (signal > l)cs4 = (signal < s)//Stochastic RSI | indicatorlengthRSI = lr //RSI periodlengthStoch = ls //Stochastic periodsmoothK = sk //Smooth signal of stochastic RSIsmoothD = sd //Smooth signal of smoothed stochastic RSImyRSI = RSI[lengthRSI](close)MinRSI = lowest[lengthStoch](myrsi)MaxRSI = highest[lengthStoch](myrsi)StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)K = average[smoothK](stochrsi)*100D = average[smoothD](K)cb5 = K>Dcs5 = K<D//Volatility FilterVol = (Std[v1](Close) / Close) * 100cb6 = Vol < v2cs6 = Vol < v3CB = cb1 AND cb2 AND cb3 and cb4 and cb5 and cb6 and mac >0CS = cs1 AND cs2 AND cs3 and cs4 and cs5 and cs6 and mac <0IF CB THENBUY positionsize CONTRACT AT MARKETSET STOP %LOSS slSET TARGET %PROFIT tpENDIF// Condiciones de salida de posiciones largasIF cs2 THENSELL AT MARKETENDIFif CS thenSellshort positionsize contract at marketSET STOP %LOSS slsSET TARGET %PROFIT tpsendifIF cb2 THENEXITSHORT AT MARKETENDIF// %trailing stop function incl. cumulative positionsonce trailingstoptype1= 1if trailingstoptype1 then//====================trailingpercentlong = tsl // %trailingpercentshort = tss // %once acceleratorlong = a1 // [1] default; always > 0 (i.e. 0.5-3)once acceleratorshort= a2 // 1 = default; always > 0 (i.e. 0.5-3)ts2sensitivity = 2 // 1 = close 2 = High/Low 3 = Low/High 4 = typicalprice (not use once)//====================once steppercentlong = (trailingpercentlong/10)*acceleratorlongonce steppercentshort = (trailingpercentshort/10)*acceleratorshortif onmarket thentrailingstartlong = positionprice*(trailingpercentlong/100)trailingstartshort = positionprice*(trailingpercentshort/100)trailingsteplong = positionprice*(steppercentlong/100)trailingstepshort = positionprice*(steppercentshort/100)endifif not onmarket or ((longonmarket and shortonmarket[1]) or (longonmarket[1] and shortonmarket)) thennewsl = 0mypositionprice = 0endifpositioncount = abs(countofposition)if newsl > 0 thenif positioncount > positioncount[1] thenif longonmarket thennewsl = max(newsl,positionprice * newsl / mypositionprice)elsenewsl = min(newsl,positionprice * newsl / mypositionprice)endifendifendifif ts2sensitivity=1 thents2sensitivitylong=closets2sensitivityshort=closeelsif ts2sensitivity=2 thents2sensitivitylong=hights2sensitivityshort=lowelsif ts2sensitivity=3 thents2sensitivitylong=lowts2sensitivityshort=highelsif ts2sensitivity=4 thents2sensitivitylong=typicalpricets2sensitivityshort=typicalpriceendifif longonmarket thenif newsl=0 and ts2sensitivitylong-positionprice>=trailingstartlong thennewsl = positionprice+trailingsteplongendifif newsl>0 and ts2sensitivitylong-newsl>=trailingsteplong thennewsl = newsl+trailingsteplongendifendifif shortonmarket thenif newsl=0 and positionprice-ts2sensitivityshort>=trailingstartshort thennewsl = positionprice-trailingstepshortendifif newsl>0 and newsl-ts2sensitivityshort>=trailingstepshort thennewsl = newsl-trailingstepshortendifendifif barindex-tradeindex>1 thenif longonmarket thenif newsl>0 thensell at newsl stopendifif newsl>0 thenif low crosses under newsl thensell at marketendifendifendifif shortonmarket thenif newsl>0 thenexitshort at newsl stopendifif newsl>0 thenif high crosses over newsl thenexitshort at marketendifendifendifendifmypositionprice = positionpriceendif//*****************************************//EXIT ZOMBIE TRADEEZT = 1if EZT thenIF longonmarket and (barindex-tradeindex(1)>= b1 and positionperf>0) or (barindex-tradeindex(1)>= b2 and positionperf<0) thensell at marketendifIF shortonmarket and (barindex-tradeindex(1)>= b3 and positionperf>0) or (barindex-tradeindex(1)>= b4 and positionperf<0) thenexitshort at marketendifendif//===================================RSIexit = 1 // in profitif RSIexit thenmyrsi2=rsi[r](close)if myrsi2<rl and barindex-tradeindex>1 and longonmarket and positionperf>0 thensell at marketendifif myrsi2>rs and barindex-tradeindex>1 and shortonmarket and positionperf>0 thenexitshort at marketendifendif3 users thanked author for this post.
11/26/2021 at 12:07 PM #182326Hi – like the look of the results. Was wondering, if you optimise on 100% of the data wouldn’t this effectively curve fit the results shown? So a higher risk that it may fall flat once live? Trying to learn – thanks
11/26/2021 at 1:08 PM #182329that’s why it needs out of sample testing. put it on demo for a few months, see what happens.
Or, you can do your own 70/30 optimization if you prefer.
I find testing in demo to be more reliable as it more closely resembles real trading conditions (changes in the spread, overnight fees etc)
1 user thanked author for this post.
11/26/2021 at 2:02 PM #182333That’s a good point. I have done the same, optimised a strategy on a 70/30 split then run in demo, and finally launched in an incubation phase on small size to test for a period of time. The issue is that the live trades don’t always match up to the back test trades (some trades are completely missing or there is a difference in profit/loss that is greater than the spread).
After all that I look to only keep those strategies which have a 90% or greater match between back test and live results. Optimising becomes dangerous if used excessively, but even still you will always get a difference between live and back test.
-
AuthorPosts
Find exclusive trading pro-tools on