- Platform
-
- Thinkorswim
Code:
# John Ehlers leading indicator https://ninjatraderecosystem.com/user-app-share-download/john-ehlers-the-leading-indicator/
# Converted to ToS - NPtechs
declare lower;
input Alpha1 = 0.25;
input Alpha2 = 0.33;
input PaintBars = Yes;
def Median = hl2;
def lb = 2 * Median + (Alpha1 - 2) * Median[1] + (1 - Alpha1) * lb[1];
def NetLead = Alpha2 * lb + (1 - Alpha2) * NetLead[1];
def Lema = 0.5 * Median + 0.5 * Lema[1];
plot pNetLead = NetLead;
pNetLead.AssignValueColor(if NetLead > Lema then COLOR.GREEN else COLOR.RED);
plot pLema = Lema;
pLema.AssignValueColor(CreateColor(33,150,243));
AssignPriceColor (if !PaintBars then Color.CURRENT else
if NetLead > Lema then Color.GREEN
else Color.RED);