I wanted to pick up on the discussion yesterday of the LBR paint bars. I looked online for a description of how Linda derived them and how they should be used, but I couldn't find anything except how they are calculated. Does anyone know of a good resource on this topic?
I have been working on this for a while. I've managed to get the color columns but I can't figure out the crossings since I believe both the 3, 10 are the same. I think. Anyway this is as far as I got. I want the 3/10 crossing above the slow 16. HELP! Driving me bonkers.
Here is the script for the indicator: and below that is what I've made so far. I don't know how to script but I managed a few things.
So far:
I have been working on this for a while. I've managed to get the color columns but I can't figure out the crossings since I believe both the 3, 10 are the same. I think. Anyway this is as far as I got. I want the 3/10 crossing above the slow 16. HELP! Driving me bonkers.
Here is the script for the indicator: and below that is what I've made so far. I don't know how to script but I managed a few things.
Code:
# TD Ameritrade IP Company, Inc. (c) 2011-2019
declare lower;
input price = close;
input calculationMode = {default Normal, Alternate};
plot FastLine;
switch (calculationMode) {
case Normal:
FastLine = Average(price, 3) - Average(price, 10);
case Alternate:
FastLine = Average(price - Average(price[3], 3), 2);
}
plot SlowLine = Average(FastLine, 16);
plot Hist = FastLine;
plot ZeroLine = 0;
FastLine.SetDefaultColor(GetColor(1));
SlowLine.SetDefaultColor(GetColor(8));
Hist.DefineColor("Positive", Color.UPTICK);
Hist.DefineColor("Negative", Color.DOWNTICK);
Hist.AssignValueColor(if Hist >= 0 then Hist.color("Positive") else Hist.color("Negative"));
Hist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Hist.HideTitle();
ZeroLine.SetDefaultColor(GetColor(7));
So far:
Code:
INPUT ma1 = 3;
INPUT ma2 = 16;
DEF ALERT =SimpleMovingAvg("length" = ma1)."SMA" crosses SimpleMovingAvg("length" = ma2)."SMA";
Alert(ALERT, "MA CROSSES MA2", Alert.BAR, Sound.Ring);
# WILL CHANGE THE COLOR OF THE TEXT INSIDE THE COLUMN BOX
AddLabel(yes, IF
SimpleMovingAvg("length" = ma1)."SMA" >
SimpleMovingAvg("length" = ma2)."SMA" THEN
ma1 ELSE ma2 ,IF
SimpleMovingAvg("length" = ma1)."SMA" <
SimpleMovingAvg("length" = ma2)."SMA" then
color.RED else color.GREEN);
#WILL CHANGE THE COLOR OF THE COLUMN BOX
AssignBackgroundColor (IF
SimpleMovingAvg("length" = ma1)."SMA" <
SimpleMovingAvg("length" = ma2)."SMA" then
color.RED else color.Light_GREEN);
#ALERT.AssignValueColor(if CLOSE > ma1 then Color.DARK_GREEN else Color.Orange);
Last edited by a moderator: