rvaidyamath
New member
Here is my Code
#code Begin
def o = open;
def c = close ;
def h = high;
def l = low;
#AddChartBubble( YES , HIGH , "OPEN :" + open[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "HIGH :" + HIGH[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "LOW:" + LOW[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "CLOSE :" + CLOSE[0], Color.WHITE, yes);
#def HAopen = CompoundValue(1, (o[1] + c[1]) / 2, (o[1] + c[1]) / 2);
def HAopen = (o[1] + c[1] ) / 2 ;
def HAclose = (o + h + l + c) / 4;
def HAhigh = Max(Max(h, HAopen), HAclose);
def HAlow = Min(Min(l, HAopen), HAclose);
def HA_green = if HAclose >= HAopen then 1 else 0;
def HA_red = if HAclose < HAopen then 1 else 0;
AddChartBubble( HA_green , HIGH , "Green: " + HA_green[0], Color.green, yes);
AddChartBubble( HA_red , HIGH , "Red: " + HA_red[0], Color.red, yes);
# code End
Screen shot below is marked where the Code is giving the wrong signals ;
Apprecaite the help - Raj
#code Begin
def o = open;
def c = close ;
def h = high;
def l = low;
#AddChartBubble( YES , HIGH , "OPEN :" + open[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "HIGH :" + HIGH[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "LOW:" + LOW[0], Color.WHITE, yes);
#AddChartBubble( YES , HIGH , "CLOSE :" + CLOSE[0], Color.WHITE, yes);
#def HAopen = CompoundValue(1, (o[1] + c[1]) / 2, (o[1] + c[1]) / 2);
def HAopen = (o[1] + c[1] ) / 2 ;
def HAclose = (o + h + l + c) / 4;
def HAhigh = Max(Max(h, HAopen), HAclose);
def HAlow = Min(Min(l, HAopen), HAclose);
def HA_green = if HAclose >= HAopen then 1 else 0;
def HA_red = if HAclose < HAopen then 1 else 0;
AddChartBubble( HA_green , HIGH , "Green: " + HA_green[0], Color.green, yes);
AddChartBubble( HA_red , HIGH , "Red: " + HA_red[0], Color.red, yes);
# code End
Screen shot below is marked where the Code is giving the wrong signals ;
Apprecaite the help - Raj