Heikin ashi + trailing stop
Forums › ProRealTime forum Italiano › Supporto ProOrder › Heikin ashi + trailing stop
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by Gael. 
Tagged: ashi, HA, heikin, heikin ashi
- 
	
		
- 
		
			
				
04/28/2021 at 10:05 PM #168318Salve, avrei un favore da chiedervi, ovvero quello di tradurre questa idea in un codice. Il trading system si basa sulle candele heikin ashi e il trailing stop. Si compra quando compare una candela heikin ashi senza un ombra inferiore e si inserisce il trailing stop alla base del corpo della candela, e non alla base di un eventuale ombra inferiore. successivamente si sposterà il trailing stop sulla candela successiva (sempre sul corpo inferiore e non sulla ombra inferiore) Per quanto riguarda la vendita, il principio rimane lo stesso, quindi si venderà alla comparsa di una candela heikin ashi senza ombra superiore e si posizionerà il trailing stop sul corpo superiore. In allegato lascio degli esempi con delle immagini. Un ultimo favore sarebbe quello di mettere il codice in .itf Rimango a disposizione per eventuali domande. Grazie in anticipo Gael 04/28/2021 at 11:03 PM #168321Eccolo: 12345678910111213141516171819202122232425262728DEFPARAM CumulateOrders = FALSEONCE xOpen = OpenxClose = (open + high + low + close) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIFxHigh = max(high,max(xClose,xOpen))xLow = min(low, min(xClose,xOpen))xBody = abs(xOpen - xClose)xUp = xHigh - max(xClose,xOpen)xDN = min(xClose,xOpen) - xLowIF xDN = 0 AND Not OnMarket THENBUY 1 Contract at MarketSL = min(xClose,xOpen)SELL at SL STOPELSIF xUP = 0 AND Not OnMarket THENSELLSHORT 1 Contract at MarketSL = max(xClose,xOpen)EXITSHORT at SL STOPENDIFIF LongOnMarket THENSL = max(SL,min(xClose,xOpen))SELL at SL STOPELSIF ShortOnMarket THENSL = min(SL,max(xClose,xOpen))EXITSHORT at SL STOPENDIF//graphonprice SL coloured(0,128,0,200)04/29/2021 at 9:05 AM #16834105/12/2021 at 6:49 PM #16951905/13/2021 at 9:33 AM #169563There you go: n. 11234567891011121314151617181920212223242526272829DEFPARAM CumulateOrders = FALSEONCE xOpen = OpenxClose = (open + high + low + close) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIFxHigh = max(high,max(xClose,xOpen))xLow = min(low, min(xClose,xOpen))xBody = abs(xOpen - xClose)xUp = xHigh - max(xClose,xOpen)xDN = min(xClose,xOpen) - xLowHalf = (xClose + xOpen) / 2IF xDN = 0 AND Not OnMarket THENBUY 1 Contract at MarketSL = min(xClose,xOpen)SELL at SL STOPELSIF xUP = 0 AND Not OnMarket THENSELLSHORT 1 Contract at MarketSL = max(xClose,xOpen)EXITSHORT at SL STOPENDIFIF LongOnMarket THENSL = max(SL,Half)SELL at SL STOPELSIF ShortOnMarket THENSL = min(SL,Half)EXITSHORT at SL STOPENDIF//graphonprice SLn. 212345678910111213141516171819202122232425262728DEFPARAM CumulateOrders = FALSEONCE xOpen = OpenxClose = (open + high + low + close) / 4IF BarIndex > 0 THENxOpen = (xOpen[1] + xClose[1]) / 2ENDIFxHigh = max(high,max(xClose,xOpen))xLow = min(low, min(xClose,xOpen))xBody = abs(xOpen - xClose)Bulls = xClose > xOpenBears = xClose < xOpenIF Bulls AND Not OnMarket THENBUY 1 Contract at MarketSL = min(xClose,xOpen)SELL at SL STOPELSIF Bears AND Not OnMarket THENSELLSHORT 1 Contract at MarketSL = max(xClose,xOpen)EXITSHORT at SL STOPENDIFIF LongOnMarket THENSL = max(SL,xLow)SELL at SL STOPELSIF ShortOnMarket THENSL = min(SL,xHigh)EXITSHORT at SL STOPENDIF//graphonprice SL05/13/2021 at 10:06 AM #16956405/13/2021 at 10:18 AM #169565Eccoli allegati. 05/13/2021 at 2:20 PM #169580
- 
		AuthorPosts
			Find exclusive trading pro-tools on 


 
		 
		 
		