# © dgtrd
#indicator('Elliott Wave Oscillator Signals by DGT', 'EWO-S ʙʏ DGT ☼☾', true, max_labels_count = 500
# converted by Sam4Cok@Samer800 -05/2023
input MovAvg = AverageType.EXPONENTIAL; # 'Use Exponential MA'
input SignalDelay = 5; # 'Signal : Delay'
input StrengthThreshold = 13; # 'Strength Threshold'
input source = close;
def na = Double.NaN;
def ewo = (MovingAverage(MovAvg, source, 5) / MovingAverage(MovAvg, source, 34) - 1) * 100;
def ewoSignal = MovingAverage(MovAvg, ewo, SignalDelay);
#// -Plotting ═════
def CrossUp = (ewo > ewoSignal) and (ewo[1] <= ewoSignal[1]);
def CrossDn = (ewo < ewoSignal) and (ewo[1] >= ewoSignal[1]);
plot StrongLong = if CrossUp and ewo < - StrengthThreshold then low else na; #'Strong Long'
plot Long = if CrossUp and ewo > - StrengthThreshold then low else na; # 'Long'
plot StrongShort = if CrossDn and ewo > StrengthThreshold then high else na; # 'Strong Short'
plot Short = if CrossDn and ewo < StrengthThreshold then high else na; # 'Short'
StrongLong.SetLineWeight(2);
StrongLong.SetDefaultColor(Color.GREEN);
StrongLong.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
long.SetDefaultColor(Color.DARK_GREEN);
Long.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
StrongShort.SetLineWeight(2);
StrongShort.SetDefaultColor(Color.RED);
StrongShort.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Short.SetDefaultColor(Color.DARK_RED);
Short.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#--- END OF CODE