In ThinkOrSwim, boolean arrows are used on the upper chart.
plots an up arrow on the low of the candle
https://tlc.thinkorswim.com/center/...ingStrategy/PaintingStrategy-BOOLEAN-ARROW-UP
plots a down arrow on the high of the candle
https://tlc.thinkorswim.com/center/...gStrategy/PaintingStrategy-BOOLEAN-ARROW-DOWN
Usage
def condition = close > open ;
plot example1 = !condition[1] and condition ;
example1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot example2 = condition[1] and !condition ;
example2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
plots an up arrow where
close is not > open on the previous bar[1] and close is > open on the current bar.
plots a down arrow where
close > open on the previous bar[1] and close is not > open on the current bar.
Helpful Hint:
if you find yourself adding arrows to your scripts on a regular basis, keep a copy of this script in your study tab: #Add Arrows to Any Script
def UPcondition = close ;
def DNcondition = close ;
plot upArrow = !UPcondition[1] and UPcondition;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upArrow.SetDefaultColor(color.cyan) ;
upArrow.SetLineWeight(1);
plot dnArrow = !DNcondition[1] and DNcondition;
dnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
dnArrow.SetDefaultColor(color.magenta) ;
dnArrow.SetLineWeight(1);
Other Examples
thinkScript can also plot wedges or dots (points) in place of arrows#
# TD Ameritrade IP Company, Inc. (c) 2018-2023
#
input adxLength = 10;
input macdFastLength = 12;
input macdSlowLength = 26;
input paintBars = yes;
def adx = reference ADX(length = adxLength);
def macd = reference MACD("fast length" = macdFastLength, "slow length" = macdSlowLength);
plot CAM_UP = adx >= adx[1] and macd > macd[1];
plot CAM_PB = adx <= adx[1] and macd < macd[1];
plot CAM_DN = adx >= adx[1] and macd < macd[1];
plot CAM_CT = adx <= adx[1] and macd > macd[1];
CAM_UP.SetDefaultColor(Color.GREEN);
CAM_UP.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
CAM_UP.SetLineWeight(3);
CAM_UP.hide();
CAM_PB.SetDefaultColor(Color.YELLOW);
CAM_PB.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
CAM_PB.SetLineWeight(3);
CAM_PB.hide();
CAM_DN.SetDefaultColor(Color.RED);
CAM_DN.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
CAM_DN.SetLineWeight(3);
CAM_DN.hide();
CAM_CT.SetDefaultColor(Color.BLUE);
CAM_CT.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
CAM_CT.SetLineWeight(3);
CAM_CT.hide();
DefineGlobalColor("CAM_UP", Color.GREEN);
DefineGlobalColor("CAM_PB", Color.YELLOW);
DefineGlobalColor("CAM_DN", Color.RED);
DefineGlobalColor("CAM_CT", Color.BLUE);
AssignPriceColor(if !paintBars then Color.CURRENT
else if CAM_UP then GlobalColor("CAM_UP")
else if CAM_PB then GlobalColor("CAM_PB")
else if CAM_DN then GlobalColor("CAM_DN")
else if CAM_CT then GlobalColor("CAM_CT")
else Color.Current);
And more examples:
https://usethinkscript.com/threads/safe-hull-moving-average-indicator-for-thinkorswim.5/#post-131601
https://usethinkscript.com/threads/...-when-signal-occurs-and-ends.3438/#post-31886
https://usethinkscript.com/threads/...ndle-based-on-breadth-open.15264/#post-124137
https://usethinkscript.com/threads/an-arrow-after-close-above-the-previous-high.14871/#post-122945