Hi Folks,
I am trying to get the study below to plot in the lower chart pane. In it's form below, it does what I want it to do (although in the upper chart pane) which is paint the bars green when TTM TrendUp is true and close is greater than FW_MOBO_Basic()."UpperBandP" and paint them red when the opposite is true. The preceding bars are grayed out to allow for focus on the current trend only.
def bar = barNumber();
def StateUp = 1;
def StateDn = 2;
def State = if TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP" then StateUp
else if TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP" then StateDn
else State[1];
def newState = HighestAll(if State <> State[1] then bar else 0);
AssignPriceColor(if bar >= newState
then if State == StateUp then Color.DARK_GREEN
else if State == StateDn then Color.RED
else Color.GRAY
else Color.GRAY);
I tried modifying the code above to the code below so that it plots in the lower chart pane but it gives me an error message that says:
AssignValueColor should be called on a IBasePlot at 11:1
At least one plot should be defined
AssignValueColor should be called on a IBasePlot at 11:1
declare lower;
def bar = barNumber();
def StateUp = 1;
def StateDn = 2;
def State = if TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP" then StateUp
else if TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP" then StateDn
else State[1];
def newState = HighestAll(if State <> State[1] then bar else 0);
AssignValueColor(if bar >= newState
then if State == StateUp then Color.DARK_GREEN
else if State == StateDn then Color.RED
else Color.GRAY
else Color.GRAY);
I am just trying to get the code to plot in the lower chart pane in the form of vertical bars that are green when TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP", red when TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP", and all previous bars are grayed out to allow focus on the current trend only.
Thanks in advance for any assistance!
I am trying to get the study below to plot in the lower chart pane. In it's form below, it does what I want it to do (although in the upper chart pane) which is paint the bars green when TTM TrendUp is true and close is greater than FW_MOBO_Basic()."UpperBandP" and paint them red when the opposite is true. The preceding bars are grayed out to allow for focus on the current trend only.
def bar = barNumber();
def StateUp = 1;
def StateDn = 2;
def State = if TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP" then StateUp
else if TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP" then StateDn
else State[1];
def newState = HighestAll(if State <> State[1] then bar else 0);
AssignPriceColor(if bar >= newState
then if State == StateUp then Color.DARK_GREEN
else if State == StateDn then Color.RED
else Color.GRAY
else Color.GRAY);
I tried modifying the code above to the code below so that it plots in the lower chart pane but it gives me an error message that says:
AssignValueColor should be called on a IBasePlot at 11:1
At least one plot should be defined
AssignValueColor should be called on a IBasePlot at 11:1
declare lower;
def bar = barNumber();
def StateUp = 1;
def StateDn = 2;
def State = if TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP" then StateUp
else if TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP" then StateDn
else State[1];
def newState = HighestAll(if State <> State[1] then bar else 0);
AssignValueColor(if bar >= newState
then if State == StateUp then Color.DARK_GREEN
else if State == StateDn then Color.RED
else Color.GRAY
else Color.GRAY);
I am just trying to get the code to plot in the lower chart pane in the form of vertical bars that are green when TTM_Trend()."TrendUp" is true and close is greater than FW_MOBO_Basic()."UpperBandP", red when TTM_Trend()."TrendDown" is true and close is less than FW_MOBO_Basic()."LowerBandP", and all previous bars are grayed out to allow focus on the current trend only.
Thanks in advance for any assistance!