TS STRATEGIA DI HULL
Forums › ProRealTime forum Italiano › Supporto ProOrder › TS STRATEGIA DI HULL
- This topic has 12 replies, 2 voices, and was last updated 2 years ago by robertogozzi.
-
-
12/29/2021 at 5:37 PM #18411412/29/2021 at 6:07 PM #184120
Eccola:
12345678HullMA = average[20,7](close)Bullish = HullMA > HullMA[1]Bearish = HullMA < HullMA[1]IF Bullish AND Not LongOnMarket THENBUY 1 CONTRACT AT MarketELSIF Bearish AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MarketENDIF01/22/2022 at 11:33 PM #186341123456789101112DEFPARAM CumulateOrders = falseMHull = HullAverage[ U ](close)MyAdx = Adx [ 5 ] > AIf MHULL > MHULL[1] and MHULL[1] < MHULL[2] and MyAdx and not LongOnMarket thenBuy 1 contract at MarketElsif MHULL < MHULL[1] and MHULL[1] > MHULL[2] and MyAdx and not ShortOnMarket thenSellshort 1 contract at MarketEndif//SET STOP pLOSS 100//SET TARGET pPROFIT 100Ciao Roberto
per favore puoi inserire un’istruzione di ritracciamento prima di aprire posizioni?
cioè quando la media di Hull cambia colore, diventa verde, allora vorrei aspettare un ritracciamento e alla prossima candela verde si va long,
al contrario quando la media diventa rossa, allora si aspetta un ritracciamento e alla prossima candela rossa si va short.
Le posizioni aperte si chiudono in stop and reverse
Grazie
01/23/2022 at 11:48 PM #18639601/25/2022 at 9:12 AM #186542Puoi fare un esempio?
01/25/2022 at 10:17 AM #18656312345678910111213141516171819202122232425262728293031323334353637383940414243444546474849DEFPARAM CumulateOrders = falseMHull = HullAverage[ U ](close)MyAdx = Adx [ 5 ] > AIf MHULL > MHULL[1] and MHULL[1] < MHULL[2] and MyAdx and not LongOnMarket thenBuy 1 contract at MarketElsif MHULL < MHULL[1] and MHULL[1] > MHULL[2] and MyAdx and not ShortOnMarket thenSellshort 1 contract at MarketEndifSET STOP pLOSS 25//trailing stop functiontrailingstart = B //trailing will start @trailinstart points profittrailingstep = C //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 STOPENDIFEccolo
01/25/2022 at 10:31 AM #186566Questo lo conosco, ma conm l’ATR cosa vorresti fare, quando dovrebbe uscire?
01/25/2022 at 10:41 AM #18656701/27/2022 at 7:17 PM #18676801/27/2022 at 7:24 PM #186770Certo che è possibile, devi solo avere un pò di pazienza.
01/29/2022 at 4:00 PM #186994Ecco fatto:
1234567891011121314151617181920212223242526272829303132333435363738DEFPARAM CumulateOrders = falseIF Not OnMarket THENStopLossL = 0StopLossS = 9999999ENDIFMHull = HullAverage[20](close)MyAdx = Adx [5] > 20If MHULL > MHULL[1] and MHULL[1] < MHULL[2] and MyAdx and not LongOnMarket thenBuy 1 contract at MarketElsif MHULL < MHULL[1] and MHULL[1] > MHULL[2] and MyAdx and not ShortOnMarket thenSellshort 1 contract at MarketEndif//SET STOP pLOSS 100//SET TARGET pPROFIT 100Atr = averagetruerange[50](close)TrailStart = 30Profitto = PositionPrice * PositionPerf / PipSizeIF Profitto >= TrailStart * PipSize THENIF StopLossL = 0 AND StopLossS = 9999999 THENStopLossL = PositionPrice + AtrStopLossS = PositionPrice - AtrENDIFENDIFIF Profitto >= TrailStart * PipSize THENIF LongOnMarket AND close > (StopLossL + Atr + TrailStart) THENStopLossL = StopLossL + AtrELSIF ShortOnMarket AND close < (StopLossS - Atr - TrailStart) THENStopLossS = StopLossS - AtrENDIFENDIFIF LongOnMarket AND StopLossL > 0 THENSELL AT StopLossL STOPELSIF ShortOnMarket AND StopLossS < 9999999 THENEXITSHORT AT StopLossS STOPENDIF//graphonprice StopLossL coloured(255,0,0,255)//graphonprice StopLossS coloured(0,0,255,255)//graph Profitto03/05/2022 at 2:23 AM #18936612345678910111213DEFPARAM CumulateOrders = false//Defparam Flatbefore=080000//Defparam Flatafter=220000HullMA = average[ 34 ,7](close)Bullish = HullMA > HullMA[1] and HULLMA[1] < HULLMA[2]Bearish = HullMA < HullMA[1] and HULLMA[1] > HULLMA[2]IF Bullish AND Not LongOnMarket THENBUY 1 CONTRACT AT MarketELSIF Bearish AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MarketENDIF//SET STOP pLOSS 20//SET TARGET pPROFIT 40Ciao Roberto
per favore puoi inserire un’istruzione di ritracciamento prima di aprire posizioni?
cioè quando la media di Hull cambia colore, diventa verde, allora vorrei aspettare un ritracciamento e alla prossima candela verde si va long,
al contrario quando la media di Hull diventa rossa, allora si aspetta un ritracciamento e alla prossima candela rossa si va short.
Le posizioni aperte si chiudono in stop and reverse
Grazie
03/05/2022 at 11:33 AM #189395Ecco il codice:
123456789101112131415161718192021222324252627282930313233DEFPARAM CumulateOrders = falseONCE SegnaleLong = 0ONCE SegnaleShort = 0ONCE PullBack = 0HullMA = average[ 34 ,7](close)Bullish = HullMA > HullMA[1] and HULLMA[1] < HULLMA[2]Bearish = HullMA < HullMA[1] and HULLMA[1] > HULLMA[2]IF Bullish THENSegnaleShort = 0SegnaleLong = 1PullBack = 0ENDIFIF Bearish THENSegnaleShort = 1SegnaleLong = 0PullBack = 0ENDIFIF SegnaleLong AND PullBack = 0 THENIF close < open THENPullBack = 1ENDIFENDIFIF SegnaleShort AND PullBack = 0 THENIF close > open THENPullBack = 1ENDIFENDIFIF SegnaleLong AND PullBack AND close > open AND Not LongOnMarket THENBUY 1 CONTRACT AT MarketENDIFIF SegnaleShort AND PullBack AND close < open AND Not ShortOnMarket THENSELLSHORT 1 CONTRACT AT MarketENDIF1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on