DEFPARAM CalculateOnLastBars = 1000
BaseCandle = 0
Open0 = Open[BaseCandle]
Close0 = Close[BaseCandle]
Open1 = Open[BaseCandle + 1]
Close1 = Close[BaseCandle + 1]
Open2 = Open[BaseCandle + 2]
Close2 = Close[BaseCandle + 2]
Open3 = Open[BaseCandle + 3]
Close3 = Close[BaseCandle + 3]
// Control height
DojiBody = ABS(Close1-Open1)
HeightLong = 7*DojiBody
// ++++++++++EVENING STAR++++++++++++
// Calcul height candelstick 2 and 2
CandleElong0 = ABS(Close0-Open0)
CandleElong2 = ABS(Close0-Open0)
// Validate Candlestick color + position
CandleE0 = Open0 > Close0 And Open0 < Close1 AND (CandleElong0>=HeightLong)
CandleE1 = Open1>Open0 AND Close1>Close0 AND Close1>Close2 AND Open1>Open2
CandleE2 = Open2 < Close2 And Close2 > Close3 And Open3 < Close3 AND (CandleElong2>=HeightLong)
EvStar = CandleE0 AND CandleE1 AND CandleE2
// ++++++++++MORNING STAR++++++++++++
// Calcul height candelstick 2 and 2
CandleMlong0 = ABS(Close0-Open0)
CandleMlong2 = ABS(Close0-Open0)
// Validate Candlestick color + position
CandleM0 = Open0 < Close0 And Open0 > Close1 AND (CandleMlong0>=HeightLong)
CandleM1 = Open1<Open0 AND Close1<Close0 AND Open1<Open2 AND Close1<Close2
CandleM2 = Open2 > Close2 And Close2 < Close3 And Open3 > Close3 AND (CandleMlong2>=HeightLong)
//Morning Star
MornStar = CandleM0 AND CandleM1 AND CandleM2
//Go Short
If EvStar then
DRAWARROWDOWN(CandleE1,LOW+5*pointsize) COLOURED(0,255,10)
endif
//Go Long
If MornStar then
DRAWARROWUP(CandleM1,LOW-5*pointsize) COLOURED(0,255,10)
endif
return