What is the best method to calculate the angle/trend of a moving average? Basically I want to keep my efs from taking longs when the 8EMA is angled downwards. Thx!
Geoff
Geoff
function preMain(){
setPriceStudy(true);
setShowCursorLabel(false);
}
var Avg = null;
function main(){
if(Avg==null) Avg = sma(8);
if(Avg.getValue(-1)==null) return;
var Slope = (Avg.getValue(0)/Avg.getValue(-1))-1;
if(Slope>0) setBarBgColor(Color.lime);
return Avg.getValue(0);
}
Comment