NAS 2m HULL-SAR trading system
Forums › ProRealTime English forum › ProOrder support › NAS 2m HULL-SAR trading system
- This topic has 343 replies, 42 voices, and was last updated 1 year ago by bege.
-
-
10/09/2020 at 8:49 AM #146827
This is a new 2m strategy I’ve been working on, uses Hull MA and Parabolic SAR in 3 time frames with cumulative orders. Short back test so may be a curve fit but the VRT is good.
I think it can still be improved but I’ve run out of ideas so any suggestions are welcome, maybe a limit to the number of positions? Cumulative orders are not to everyone’s taste, and the drawdown is huge – you’d need a lot of capital to run it – but as a % of the runup it’s not that bad. Could be worth playing with…
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495Ctime = time >=143000 and time <210000TIMEFRAME(18 minutes)Period= 155inner = 2*weightedaverage[round( Period/2)](typicalprice)-weightedaverage[Period](typicalprice)HULLa = weightedaverage[round(sqrt(Period))](inner)c1 = HULLa > HULLa[1]c2 = HULLa < HULLa[1]ST1 = SAR[.005,.005,.02]c1a = (close > ST1)c2a = (close < ST1)TIMEFRAME(6 minutes)Periodb= 29innerb = 2*weightedaverage[round( Periodb/2)](typicalprice)-weightedaverage[Periodb](typicalprice)HULLb = weightedaverage[round(sqrt(Periodb))](innerb)c3 = HULLb > HULLb[1]c4 = HULLb < HULLb[1]ST2 = SAR[.005,.005,.02]c3a = (close > ST2)c4a = (close < ST2)TIMEFRAME(default)Periodc= 4innerc = 2*weightedaverage[round( Periodc/2)](typicalprice)-weightedaverage[Periodc](typicalprice)HULLc = weightedaverage[round(sqrt(Periodc))](innerc)c5 = HULLc > HULLc[1] and HULLc[1] < HULLc[2]c6 = HULLc < HULLc[1] and HULLc[1] > HULLc[2]ST3 = SAR[.01,.01,.005]c5a = (close > ST3)c6a = (close < ST3)// Conditions to enter long positionsIF Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a THENBUY positionsize CONTRACT AT MARKETSET STOP %LOSS .7SET TARGET %PROFIT 1.7ENDIF// Conditions to enter short positionsIF Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a THENSELLSHORT positionsize CONTRACT AT MARKETSET STOP %LOSS 1.1SET TARGET %PROFIT 1.3ENDIF//%trailing stop functiontrailingstop = 1if trailingstop =1 thenonce trailingPercent = 0.38once stepPercent = 0.006if onmarket thentrailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailingstart points profittrailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stoplossendif//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart THENnewSL = tradeprice(1)+trailingstepENDIF//next movesIF newSL>0 AND close-newSL>trailingstep THENnewSL = newSL+trailingstepENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart THENnewSL = tradeprice(1)-trailingstepENDIF//next movesIF newSL>0 AND newSL-close>trailingstep THENnewSL = newSL-trailingstepENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIFendifTotal of 11 users thanked author for this post. Here are last 10 listed.
10/09/2020 at 10:30 AM #146848Excellent G/L-ratio on that amount of trades.
1 user thanked author for this post.
10/09/2020 at 10:54 AM #146852I agree that the max amount of cumulative orders should be an option to avoid anxiety. For example this:
123456789101112131415MaxPositionsAllowed = 5// Conditions to enter long positionsIF ctime and c1 and c1a AND C3 and c3a AND C5 and c5a and abs(CountOfPosition) < MaxPositionsAllowed THENBUY 1 CONTRACT AT MARKETSET STOP %LOSS .7SET TARGET %PROFIT 1.7ENDIF// Conditions to enter short positionsIF ctime and c2 and c2a AND C4 and c4a AND C6 and c6a and abs(CountOfPosition) < MaxPositionsAllowed THENSELLSHORT 1 CONTRACT AT MARKETSET STOP %LOSS 1.1SET TARGET %PROFIT 1.3ENDIF1 user thanked author for this post.
10/09/2020 at 11:32 AM #146858Cumulative orders are not to everyone’s taste
Looks good with CumulateOrders = False.
Also positive on performance on 1m and 3m.
Thank you very much for sharing @nonetheless
Can’t wait for 14:30 to see how it performs on Demo Live! 🙂
1 user thanked author for this post.
10/09/2020 at 12:45 PM #14686610/09/2020 at 1:01 PM #146871I don’t think the VRT can be useful on that amount of trades, so be careful before going live.
I think you’re prob right, but with such a short back test WF wouldn’t tell us much either. It would certainly be discouraging if the VRT were bad. But all short TF systems have to be left on demo for a good few months. Work in progress…
10/09/2020 at 1:38 PM #146879I agree that the max amount of cumulative orders should be an option to avoid anxiety.
Thanks for that @Swedshare, defiinitely worth adding. I was hoping that the back test would show a clear optimum, but it’s really a direct correlation: more positions = more profit. But it’s worth having for the sake of peace of mind, ie how many positions you feel comfortable with. Max positions = 5 still shows ~ €25k profit in the past year.10/09/2020 at 3:10 PM #146890Looks nice nonetheless . Thanks for sharing!
I always have doubts having multiple positions, the way exits are handled are a bit tricky.
If you have xx positions and a new position is openend and a new stop loss is set, the stop loss level for the last position counts for all positions?
That could work positive but also negative in terms of acceptable risk.
Maybe there’s a difference, adding only to a winning position, which means the first positions stop loss is lowered and the risk is reduced.
Same works a bit similar for the trailing stop, but what happens if using instead of trade price(1) position price?
10/09/2020 at 3:54 PM #146897here’s the quick change, same ts but using position price and adding to winning positions.
Didn’t optimise stop loss & profit targets.
now I look about it, it using positionperf(0) below, but perhaps better is to look at the positionperf of all current trades in same direction and if that’s positive add a position.
12345678910111213141516171819202122232425262728MaxPositionsAllowed = 9999// Conditions to enter long positionsIF not longonmarket and Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a THENBUY positionsize CONTRACT AT MARKETSET STOP %LOSS 1.5SET TARGET %PROFIT 2.5elsif longonmarket and Ctime and c1 and c1a AND C3 and c3a AND C5 and c5a and abs(CountOfPosition) < MaxPositionsAllowed THENif positionperf(0)*100>0 thenBUY positionsize CONTRACT AT MARKETSET STOP %LOSS 1.5SET TARGET %PROFIT 2.5endifendif// Conditions to enter short positionsIF not shortonmarket and Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a THENSELLSHORT positionsize CONTRACT AT MARKETSET STOP %LOSS 1.5SET TARGET %PROFIT 2.5elsif shortonmarket and Ctime and c2 and c2a AND C4 and c4a AND C6 and c6a and abs(CountOfPosition) < MaxPositionsAllowed THENif positionperf(0)*100>0 thenSELLSHORT positionsize CONTRACT AT MARKETSET STOP %LOSS 1.5SET TARGET %PROFIT 2.5endifendif10/09/2020 at 4:19 PM #14690010/09/2020 at 4:39 PM #146905new position is openend and a new stop loss is set, the stop loss level for the last position counts for all positions?
Hi Paul, from what I can see in demo, all the stops are different, measured from each entry point.
Only adding to winning positions could be a good idea – i’ll have to play around with it. Of course, then you lose the benefit of averaging down your losing positions. The question is how much you trust the primary trend.
I also tried adding exit conditions, when any of the indicators changed direction, but couldn’t get any improvement. There must be a better way to get out of a losing position without going all the way to the stop… maybe something like the Fibonacci exits you have in your DJ 3m Vectorial – would that bit of code work as it is?
10/09/2020 at 5:46 PM #146913Hi Paul, from what I can see in demo, all the stops are different, measured from each entry point.
Hi, then it’s perfect! I wasn’t sure.
about the Fibonacci exits, yes it does add something too it, it appears. That’s nice to see, especially in another market (often it breaks down), but if it’s enough to keep it? I used hour 0 to hour 8 or 9.
Using position price instead of trade price the results go down a bit.
10/09/2020 at 6:06 PM #146917One thing I just noticed, although the stop loss is set individually for each new position, it doesn’t seem to change when the trail moves up. At the moment there are 18 open positions, most of which are up by around .6% but the stop hasn’t moved, even though the trail should go to break even at .38 %
It’s even above the aggregate price by more than that.
Does anyone know how a trailing stop is supposed to work with cumulative orders?
10/09/2020 at 9:33 PM #14693610/09/2020 at 9:57 PM #146940No, it didn’t but how can it ever if new positions are always being added? It would have to go .38 % without the slightest pullback or it’ll take another trade and start a new trail from there.
-
AuthorPosts
Find exclusive trading pro-tools on