Neutral Zone Strategy
Forums › ProRealTime English forum › ProOrder support › Neutral Zone Strategy
- This topic has 35 replies, 8 voices, and was last updated 4 years ago by
paisantrader.
-
-
02/03/2021 at 6:41 PM #16028102/03/2021 at 6:53 PM #16028302/04/2021 at 10:23 AM #16031402/04/2021 at 10:42 AM #16031802/04/2021 at 4:02 PM #16035802/04/2021 at 5:59 PM #160368
Hi Tanou, the idea I had use market direction before opening reduces the trades too much.
The buy/sellshort stop order does work, for i.e. on 1 minute but it could mean a delayed entry compared to 10s because of Heikin-Ashi. In the past I worked on OpenStraddle DAX v6p, a bit similar.
02/08/2021 at 10:15 AM #16063502/08/2021 at 10:44 AM #16063902/08/2021 at 10:49 AM #16064002/08/2021 at 12:38 PM #160673forget about barhunter
It happens in your strategy you use time and opentime together. Not saying it’s wrong here, but it’s tricky!
Another way to use a reset is with intradaybarindex=0. It has influence on results though.
You used Heikin-Ashi in the trailingstop, which for me complicates things. Not so easy to improve on this strategy.
02/08/2021 at 2:58 PM #16069202/08/2021 at 6:40 PM #160728That’s the downside not posting it in the library 🙂 Spent a lot of time on thisone.
Barhunter was a strategy that searches for a bar where it would setup a breakpoint (straddle sortoff) for long & short with stop order for entry. So it uses 1hour timeframe to do the backtest, and after finding it, you switch mode and use 1 minute timeframe to create the same results you had in the backtest of 1 hour. Pretty good implantation of the trailing stop too.
So 1h is easy, you optimise 24 bars and it found that hour 3/4 is the best hour. That in combination with trend detection system & breakpointpercentage .
here’s the link
1https://www.prorealcode.com/topic/strategy-barhunter-dax-v1p/Will post a few charts there.
03/14/2021 at 2:08 PM #164116Here’s a version of this with a few tweaks – added MM, TP and allowance for American DLS which makes a big difference. Works quite well for a very short backtest, but I don’t understand why it takes 10x more short trades than long? Should be room for improvement there.
03/17/2021 at 9:29 AM #164428Hello @Nonetheless !
It is because it is th short version 😀
Here is the long one 😉 (I can’t make it linear, if you have ideas!)
Long Neutral Zone123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116//-------------------------------------------------------------------------// Code principal : Neutral Zone Long.//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : Neutral Zone Long//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Code principal : Neutral Zone Long//-------------------------------------------------------------------------DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 50000// Annule tous les ordres en attente et ferme toutes les positions à 0:00, puis empêche toute création d'ordre avant l'heure "FLATBEFORE".DEFPARAM FLATBEFORE = 152900// Annule tous les ordres en attente et ferme toutes les positions à l'heure "FLATAFTER"DEFPARAM FLATAFTER = 220000// Variables / Réglages :TimeOpen = 153000TimeClose = 220000x=21 //Taille de la zone autour de l'ouverture pour activation/Désactivation//-----------------------------------------------------------------------------------------------------------------------------------------------------//HORAIRES DE TRADINGCtime = time >= TimeOpen and time < TimeClose//--------------------------------------//Nouveau OpenPrice et OpenDay a 15:30IF OPENTIME = (TimeOpen) thenOpenPrice = OpenOpenD = OpenDaystrategyprofitpoint=0l = 0s = 0count = 0debutopen = barindexENDIFif(strategyprofit<>strategyprofit[1]) thenstrategyprofitpoint = (strategyprofit-strategyprofit[1])/pointvalueendif//------------------------------------//Représentation graphique Heikin-Ashionce xOpen = openPrice = (open + close + low + high)/4if barindex > 0 thenxOpen = (xOpen + Price[1]) / 2endifxLow = min(low,min(Price,xOpen))xHigh = max(high,max(Price,xOpen))GreenHA = Price > xOpenRedHA = Price < xOpen//------------------------------------// STRATEGIE ---------------------------------------------------------------------------------// Conditions ShortIf s=0 thenIf xHigh=xOpen and xHigh<(OpenPrice-x) thens1 = 1Elses1 = 0EndifEndif//Conditions LongIf l=0 thenIf xLow=xOpen and xLow>(OpenPrice+x) thenl1 = 1Elsel1=0EndifEndif//-------------------------------------------------------------------------------------------//POSITION LONGUEIF l1 and strategyprofitpoint<=0 and count<2 and ctime THENBuy 1 contract at marketl1 = 0l = 1count = count + 1ENDIF//POSITION COURTEIF s1 and not onmarket and strategyprofitpoint<=0 and count<2 and ctime THENs1 = 0count = count + 1ENDIF//POSITION COURTEIF s1 and strategyprofitpoint<=0 and count>=1 and count<2 and ctime THENSellshort 1 contract at markets1 = 0s = 1count = count + 1ENDIF//TP et SL ---------------------------------------------------------------------------------//VariablesNATR = 14 //ATR PeriodSATR = 20 // ATR Multiplier for StopPATR = 1// ATR Multiplier for Profit//Stop and TargetSET STOP LOSS SATR*AverageTrueRange[NATR](close)SET TARGET PROFIT PATR*AverageTrueRange[NATR](close)1 user thanked author for this post.
03/17/2021 at 11:07 AM #164440It is because it is th short version
Salut Tanou – yes, I did see that you had posted long and short versions, what I meant is that it seemed odd that they weren’t completely exclusive – the short version still takes some long trades and vice versa.
This is the best I could do for a fully ambidextrous version, lots more trades, more or less equal long and short … but only slightly more profitable and less stable. Hard to say if it’s worth it with a short backtest ???
I added an MA on the 2m TF, but this is the main change:
123456789101112131415161718//POSITION LONGUEIF l1 and strategyprofitpoint<=0 and count<2 and ctime and cb1 THENBuy PositionSize contract at marketl1 = 0l = 1count = count + 1SET TARGET %PROFIT tpENDIF//POSITION COURTEIF s1 and strategyprofitpoint<=0 and count<2 and ctime and cs1 THENSellshort PositionSize contract at markets1 = 0s = 1count = count + 1SET TARGET %PROFIT tpsENDIF1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on