Trend Meter
Trend Meter
Trend Meter
iGreen=(close > petd) and (close > petx) and (close > pety)
iBlue = ((close > petd) or (close > petx) or (close > pety)) and not ((close >
petd) and (close > petx) and (close > pety)) and not ((close < petd) and (close <
petx) and (close < pety))
iRed = (close < petd) and (close < petx) and (close < pety)
up = (close > petd) and (close > petx) and (close > pety) ? green : (close > petd)
or (close > petx) or (close > pety) ? blue : red
test = (petd + petx + pety) /3
//plot(out2 and smaplot ? out2 :na , title="SMA", color=mycolor2, linewidth=1)
plot(test, title="Buy Sell", color= white )
barcolor(up)
conditioncrossover=crossover(test, close)
conditioncrossunder=crossunder(test, close)
alertcondition(conditioncrossover,"Crossing Up","Crossing Up")
alertcondition(conditioncrossunder,"Crossing Down","Crossing Down")
tbuy=test - pety
t2buy= (tbuy / test)*100
Last5Avg= (CurrentMA[3]+CurrentMA[4]+CurrentMA[5]+CurrentMA[6]+CurrentMA[7]) /5
samIncrese=CurrentMA-LastMA
samPercIncrese=(samIncrese/CurrentMA )* 100
samDecrease=LastMA - CurrentMA
samPercDecrease=(samDecrease/LastMA )* 100
LastAvgDec= Last5Avg-CurrentMA
LastAvgPercDecrease=(LastAvgDec/Last5Avg )* 100
LastAvgInc= CurrentMA-Last5Avg
LastAvgPercIncrease=(CurrentMA/Last5Avg )* 100
//Simple Buysell
//plotshape(buy, title= "Buy", location=location.belowbar, color=lime,
style=shape.arrowup, text="")
//plotshape(sell, title= "Sell", location=location.abovebar, color=red,
style=shape.arrowdown, text="")