Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study("magarto Method",overlay=false)
- ma=sma(close,30)
- maslope=ma-ma[2]
- maslopeB=iff(maslope<0,-1,iff(maslope>0,1,0))
- candleOver=iff(ohlc4>ma,1,-1)
- xMA = ema(close,13)
- DayLow = iff(dayofmonth != dayofmonth[1], low, min(low, nz(DayLow[1])))
- bearpower = DayLow - xMA
- DayHigh = iff(dayofmonth != dayofmonth[1], high, max(high, nz(DayHigh[1])))
- bullpower = DayHigh - xMA
- bothElder=iff((bearpower>0 and bullpower>0),1,iff((bearpower<0 and bullpower<0),-1,0))
- all4=maslopeB+candleOver+bothElder
- plot(all4)
- hline(3)
- hline(-3)
- buy = all4 == -3 ? all4 : na
- sell = all4 == 3 ? all4 : na
- plot(buy, style=circles, linewidth=4, color=green)
- plot(sell, style=circles, linewidth=4, color=red)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement