Freddie_CM
Member
Hey All!
I'm in need of assistance with plotting arrows on the Stochastic Momentum Index. I'd like to have an "Up Arrow" plot when the SMI and the AvgSMI both cross above -40. Conversely, I'd like to have a "Down Arrow" plot when the SMI and AvgSMI cross below 40. I've searched for a script like this and have found similar scripts but not an exact one that I need. If anyone can help out with this, that would be fantastic. TIA!
Here is the script that I will need edited for arrows:
I'm in need of assistance with plotting arrows on the Stochastic Momentum Index. I'd like to have an "Up Arrow" plot when the SMI and the AvgSMI both cross above -40. Conversely, I'd like to have a "Down Arrow" plot when the SMI and AvgSMI cross below 40. I've searched for a script like this and have found similar scripts but not an exact one that I need. If anyone can help out with this, that would be fantastic. TIA!
Here is the script that I will need edited for arrows:
Code:
declare lower;
input over_bought = 40.0;
input over_sold = -40.0;
input percentDLength = 3;
input percentKLength = 5;
def min_low = lowest(low, percentKLength);
def max_high = highest(high, percentKLength);
def rel_diff = close - (max_high + min_low)/2;
def diff = max_high - min_low;
def avgrel = expaverage(expaverage(rel_diff, percentDLength), percentDLength);
def avgdiff = expaverage(expaverage(diff, percentDLength), percentDLength);
plot SMI = if avgdiff != 0 then avgrel / (avgdiff / 2) * 100 else 0;
smi.setDefaultColor(getColor(1));
plot AvgSMI = expaverage(smi, percentDLength);
avgsmi.setDefaultColor(getcolor(5));
plot overbought = over_bought;
overbought.setDefaultColor(getcolor(5));
plot oversold = over_sold;
oversold.setDefaultColor(getcolor(5));