Nice job there evilsurgeon. I do sometimes wonder that watchlist columns don't seem to receive the attention that scans do but for my purposes they are indispensable.I made a watch list for this indicator. The numbers show up fine, but the background color does not. It is the same code I use for my other WL indicators. Maybe the code is too complex. I have tried a number of iterations of splitting up the labels and background colors, nothing seems to work. Any thoughts? Thanks!
Code:#SAI Add 12-14-21 # Mobius # V01.01.29.2019 # Uses trend of higher highs with higher lows and trend of lower lows with lower highs to locate pivots. Distance for trend is set by the user. Confirmation of a reversal from pivots is set with a multiple of the pivot bars range. That multiple is also a user input. # Trading Rules # 1) Trade when price crosses and closes outside the pivot Confirmation line. At that point looking for best entry. Min trade is 2 contracts # 2) Know your risk point before entering trade. Typical risk point is the pivot line itself. If your risk is crossed look for an exit. Never use hard stops - you'll often get out for little or no loss # 3) Know your Risk off point before entering. Typical Risk Off is an ATR multiple. Offer Risk Off as soon as possible for a Risk Free trade # 4) set mental stop one tick above entry when Risk Off is achieved # 5) if trade continues your way move mental stop for your runner to last support / resistance each time a new support / resistance is hit. #BTO = buy to open #LL = lower lows (bottom-most line of green plot) #STO = sell to open #HH = higher highs (top-most line of red plot) #STO_RO = Sell to Open Risk On #BTO_RO = Buy to Open Risk On def n = 5; def R_Mult = 1.5; def o = open; def h = high; def l = low; def c = close; def x = BarNumber(); def nan = Double.NaN; def ts = tickSize(); def tr = TrueRange(h, c, l); def hh = if Sum(h > h[1], n) >= n and Sum(l > l[1], n) >= n-1 then h else if h > hh[1] then h else hh[1]; def xh = if h == hh then x else nan; def hh_ = if x >= HighestAll(xh) then HighestAll(if IsNaN(c[-1]) then hh else nan) else nan; def hR = if h == hh then Round(Average(tr, n)/TickSize(), 0)*TickSize() else hR[1]; def PrevL = if h == hh then l[1] else PrevL[1]; def STO = if x >= HighestAll(xh) then HighestAll(if IsNaN(c[-1]) then Round((Max(PrevL, hh_ - (hR * R_Mult))) / ts, 0) * ts else nan) else nan; def STO_RO = if x >= HighestAll(xh) then HighestAll(if isNaN(c[-1]) then STO - Min(hR, TickSize() * 16) else nan) else nan; def ll = if Sum(l < l[1], n) >= n and Sum(h < h[1], n) >= n-1 then l else if l < ll[1] then l else ll[1]; def xl = if l == ll then x else nan; def ll_ = if x >= HighestAll(xl) then HighestAll(if IsNaN(c[-1]) then ll else nan) else nan; def lR = if l == ll then Round(Average(tr, n)/TickSize(), 0)*TickSize() else lR[1]; def PrevH = if l == ll then h[1] else PrevH[1]; def BTO = if x >= HighestAll(xl) then HighestAll(if IsNaN(c[-1]) then Round((Min(PrevH, ll_ + (lR * R_Mult))) / ts, 0) * ts else nan) else nan; ; def BTO_RO = if x >= HighestAll(xl) then HighestAll(if isNaN(c[-1]) then BTO + Min(lR, TickSize() * 16) else nan) else nan; # End Code Trend Pivots #~~~~~~~~~~~~~~~~~~~~~~~~ begin signals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def datadn = close[1] > STO and close < STO; def dataup = close[1] < BTO and close > BTO; def datadn_RO = close[1] > STO_RO and close < STO_RO; def dataup_RO = close[1] < BTO_RO and close > BTO_RO; AddLabel(yes, if datadn then "STO $" + STO else if dataup then "BTO $" + BTO else if datadn_RO then "STO_RO $" + STO_RO else if dataup_RO then "BTO_RO $" + BTO_RO else " ", color.white); AssignBackgroundColor(if datadn then color.red else if dataup then color.dark_green else if datadn_RO then color.dark_orange else if dataup_RO then color.green else color.black); #~~~~~~~~~~~~~~~~~~~~~~~~~ end signals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Colored or not I'll be using this. Thanks