Custom Indicator /ES with $Tick Divergence (Need Help Coding)

T

Trader_Vic

New member
VIP
Hi Guys! I joined this site a few months ago and this is such an amazing site for traders and coders to come together. I would need some help from someone who can write a code with this Strategy. I trade /ES on 5 Min & 1 Min Chart with $TICK as the bottom indicator. I usually draw lines every time there is a divergence or a flag formation for the TICKS to go Long or Short. I would need help from coders on this site to help me with the CODE.

Here are some

 
Last edited by a moderator:
  • Like
Reactions: GOS
T

Trader_Vic

New member
VIP
Here is a Clear Image.

 
Last edited by a moderator:
AlexBallas

AlexBallas

New member
@Trader_Vic Hi did. you ever get this INDICATOR ? Please advise :)
 
T

Trader_Vic

New member
VIP
@AlexBallas - I have not gotten the indicator yet
 
M

mayhem

New member
I'd also be very interested in seeing this. I believe it already exists as a tradestation indicator which plots a dot at a price pivot when $tick confirms with its own high vs prior price pivots.
 
BenTen

BenTen

Administrative
Staff
VIP
I found this, not sure if it's what you guys are looking for:

Code:
# $TICK Oscillator with Divergence
# Mobius
# V01.03.2020

declare lower;

input length = 5;
input AvgType = AverageType.HULL;

addLabel(1, "Green Line sloping up or red sloping down is divergence", color.white);
def o = open("$TICK");
def h = high("$TICK");
def l = low("$TICK");
def c = close("$TICK");
def x = BarNumber();
def nan = Double.NaN;
AddChart(h, l, c, o, ChartType.CANDLE, Color.YELLOW);
AddChart(h, l, o, c, ChartType.CANDLE, Color.CYAN);
def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());
plot "0" = if !RTH then Double.NaN else 0;
     "0".SetDefaultColor(Color.MAGENTA);
     "0".HideBubble();
     "0".HideTitle();
plot avg = MovingAverage(AvgType, c, length);
     avg.AssignValueColor(if avg < 0
                          then color.red
                          else color.green);
     avg.HideBubble();
     avg.HideTitle();
addCloud(0, avg, color.red, color.green);
plot upArrow = if avg crosses above 0
               then l
               else double.nan;
     upArrow.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
     upArrow.SetDefaultColor(Color.Green);
     upArrow.SetLineWeight(3);
     upArrow.HideBubble();
     upArrow.HideTitle();
plot dnArrow = if avg crosses below 0
               then h
               else double.nan;
     dnArrow.SetPaintingStrategy(PaintingStrategy.Arrow_DOWN);
     dnArrow.SetDefaultColor(Color.Red);
     dnArrow.SetLineWeight(3);
     dnArrow.HideBubble();
     dnArrow.HideTitle();
def hh = if avg crosses above 0
         then h
         else if avg > 0 and h > hh[1]
         then h
         else hh[1];
def xh = if h == hh
         then x
         else xh[1];
plot hp = if x == highestAll(xh)
          then hh
          else nan;
     hp.SetStyle(Curve.Points);
     hp.SetDefaultColor(Color.red);
     hp.SetLineWeight(3);
     hp.HideBubble();
     hp.HideTitle();
def xh1 = if !isNaN(dnArrow)
          then getValue(xh, 2)
          else xh1[1];
plot hp1 = if x == highestAll(xh1)
           then h
           else nan;
     hp1.SetStyle(Curve.Points);
     hp1.SetDefaultColor(Color.red);
     hp1.SetLineWeight(3);
     hp1.HideBubble();
     hp1.HideTitle();
plot hd = if x == highestAll(xh1)
          then h
          else if x == highestAll(xh)
          then h
          else nan;
     hd.EnableApproximation();
     hd.SetDefaultColor(Color.red);
     hd.HideBubble();
     hd.HideTitle();
def ll = if avg crosses below 0
         then l
         else if avg < 0 and l < ll[1]
         then l
         else ll[1];
def xl = if l == ll
         then x
         else xl[1];
plot lp = if x == highestAll(xl)
          then ll
          else nan;
     lp.SetStyle(Curve.Points);
     lp.SetDefaultColor(Color.green);
     lp.SetLineWeight(3);
     lp.HideBubble();
     lp.HideTitle();
def xl1 = if !isNaN(dnArrow)
          then xl[1]
          else xl1[1];
plot lp1 = if x == highestAll(xl1)
           then l
           else nan;
     lp1.SetStyle(Curve.Points);
     lp1.SetDefaultColor(Color.green);
     lp1.SetLineWeight(3);
     lp1.HideBubble();
     lp1.HideTitle();
plot ld = if x == highestAll(xl1)
          then l
          else if x == highestAll(xl)
          then l
          else nan;
     ld.EnableApproximation();
     ld.SetDefaultColor(Color.green);
     ld.HideBubble();
     ld.HideTitle();
# End Code TICK Oscillator with Divergence


# AI Adds

def lastHP = if x == highestAll(xh)
then xh else lastHP[1];
def lastHP1 =  if x == highestAll(xh1)
then xh1 else lastHP[1];
def lastLP = if x == highestAll(xl)
then xl else lastLP[1];
def lastLP1 =  if x == highestAll(xl1)
then xl1 else lastLP1[1];

Addlabel(lastHP1<lastHP,"Divergent",color.red);
Addlabel(lastLP1>lastLP,"Divergent",color.green);
 
M

mayhem

New member
Wow! this is great! Thanks @BenTen !!!. I'm not the original poster but this is what I'm looking for. Can't speak for Trader_Vic. I really appreciate you finding this and for Mobius creating this.
 

Similar threads

Top