How to create a scan for the entry and exit arrows in the lower indicator? This is part of another indicator.
See lower indicator below;
See lower indicator below;
Code:
declare lower;
input showpositionbubble = yes;
input showentrybubble = yes;
input entryarrows = yes;
input STpricecolor = no;
input combopricecolor = yes;
input CCIATRPriceColor = no;
input alerts = no;
input showlocationbubble = no;
input Factor = 1.3;
input Pd = 60;
input Lookback = 3;
input usecloud = yes;
input vertLine = yes;
input lengthCCI = 20;
input lengthATR = 4;
input AtrFactor = 0.70;
def pricedata = HL2[Lookback];
DefineGlobalColor("TrendUp", CreateColor(0, 255, 255));
DefineGlobalColor("TrendDown", CreateColor(0, 102, 255));
def Up = pricedata - (Factor * ATR(Pd));
def Dn = pricedata + (Factor * ATR(Pd));
def TrendUp = if close[1] > TrendUp[1] then Max(Up, TrendUp[1]) else Up;
def TrendDown = if close[1] < TrendDown[1] then Min(Dn, TrendDown[1]) else Dn;
def Trend = if close > TrendDown[1] then 1 else if close < TrendUp[1] then -1 else (Trend[1]);
plot Tsl = if Trend == 1 then TrendUp else TrendDown;
Tsl.AssignValueColor(if Trend == 1 then GlobalColor("TrendUp") else GlobalColor("TrendDown")); #SuperTrend
Tsl.SetLineWeight(3);
plot entryArrow = (if Trend == 1 and Trend[1] == -1 then Trend else Double.NaN); #Up Entry Arrow
entryArrow.SetDefaultColor(Color.WHITE);
entryArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
entryarrow.SetHiding(!entryarrows);
plot exitArrow = (if Trend == -1 and Trend[1] == 1 then Trend else Double.NaN); #Down Entry Arrow
exitArrow.SetDefaultColor(Color.YELLOW);
exitArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
exitArrow.SetHiding(!entryarrows);
Last edited by a moderator: