Control height of arrow plots and other painting strategies?

lmk99

Member
Hi all,

I would like to change the height of signal arrows that are plotting from a study, because I'm using another study that displays values ("PaintingStrategy.values_above" and "PaintingStrategy.values_below"), and when the arrow signals are generated, the arrows cover up the values that display underneath and over the candles. Is there a way to control this?
 

lmk99

Member
Thanks for offering! It's the Halftrend indicator from this thread, this is the section of the code with the arrow plot attributes:

Code:
def buyTrigger = buy_criteria[-1] ;
plot buyTriggerPlot = if buyTrigger[1] and (lowavg[0]>=lowavg[1]) then plotLow else Double.NaN;
buyTriggerPlot.SetDefaultColor(GlobalColor("VividCyan"));
buyTriggerPlot.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
buyTriggerPlot.SetLineWeight(1);
buyTriggerPlot.HideTitle() ;

def sellTrigger = sell_criteria[-1] ;
plot sellTriggerPlot = if sellTrigger[1] then plotHigh else Double.NaN;
sellTriggerPlot.HideBubble() ;
sellTriggerPlot.HideTitle() ;
sellTriggerPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellTriggerPlot.SetLineWeight(5);
sellTriggerPlot.SetDefaultColor(Color.LIGHT_ORANGE) ;
 

MerryDay

Administrative
Staff member
Staff
VIP
You cannot control boolean arrows for all other signals, add the following code before your plots. Change the "0.3" higher or lower to meet your requirements:
Code:
# ########################################################
# charting & formatting
def arrow_plots = high – low;
def plotHigh    = high + arrow_plots * 0.3;
def plotLow     = low  - arrow_plots * 0.3;
# ########################################################
 

lmk99

Member
Is there a reason that I can't just change the boolean arrows to non-boolean ones? Maybe I'm missing some basic conceptual point about this because it seems to me like if the "SellTrigger" condition is still controlling whether the arrow will be plotted, it can be plotted correctly regardless of whether it's specified as a boolean arrow or not.

EDIT: Changing BOOLEAN_ARROW_UP to ARROW_UP seems to work fine, at least in this case. Thanks for your help!
 
Last edited:

TrueDepth

Member
VIP
Yep, on this code you can just change the boolean arrows to non-boolean. To use MerryDay's way, it would be this:
(Remove old def plotHigh and def plotLow) Let me know if it works.


Code:
# ########################################################
# charting & formatting
def arrow_plots = high – low;
def plotHigh    = high + arrow_plots * 0.3;
def plotLow     = low  - arrow_plots * 0.3;
# ########################################################
def buyTrigger = buy_criteria[-1] ;
plot buyTriggerPlot = if buyTrigger[1] and (lowavg[0]>=lowavg[1]) then plotLow else Double.NaN;
buyTriggerPlot.SetDefaultColor(GlobalColor("VividCyan"));
buyTriggerPlot.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
buyTriggerPlot.SetLineWeight(1);
buyTriggerPlot.HideTitle() ;

def sellTrigger = sell_criteria[-1] ;
plot sellTriggerPlot = if sellTrigger[1] then plotHigh else Double.NaN;
sellTriggerPlot.HideBubble() ;
sellTriggerPlot.HideTitle() ;
sellTriggerPlot.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
sellTriggerPlot.SetLineWeight(5);
sellTriggerPlot.SetDefaultColor(Color.LIGHT_ORANGE) ;
 

lmk99

Member
Yep, on this code you can just change the boolean arrows to non-boolean. To use MerryDay's way, it would be this:
(Remove old def plotHigh and def plotLow) Let me know if it works.


Code:
# ########################################################
# charting & formatting
def arrow_plots = high – low;
def plotHigh    = high + arrow_plots * 0.3;
def plotLow     = low  - arrow_plots * 0.3;
# ########################################################
def buyTrigger = buy_criteria[-1] ;
plot buyTriggerPlot = if buyTrigger[1] and (lowavg[0]>=lowavg[1]) then plotLow else Double.NaN;
buyTriggerPlot.SetDefaultColor(GlobalColor("VividCyan"));
buyTriggerPlot.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
buyTriggerPlot.SetLineWeight(1);
buyTriggerPlot.HideTitle() ;

def sellTrigger = sell_criteria[-1] ;
plot sellTriggerPlot = if sellTrigger[1] then plotHigh else Double.NaN;
sellTriggerPlot.HideBubble() ;
sellTriggerPlot.HideTitle() ;
sellTriggerPlot.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
sellTriggerPlot.SetLineWeight(5);
sellTriggerPlot.SetDefaultColor(Color.LIGHT_ORANGE) ;

Worked great. Thank you both!
 

Similar threads

Top