Need non-repainting functionality similar to ZigZagHighLow

Bassindora

Member
VIP
I continue to refine my chart window to avoid multi-collinearity for intraday trading. It is coming along pretty well.

In order to identify potential candidate stocks quickly, I developed a custom watch list column that did a running total of all the indicators in that window that were in a "BUY" state.

The challenge I had was that by the time enough of them were in the buy state, I found I was too late to catch the early run.

Throughout that process, I noticed that the AGAIG_NoArrows indicator by @crickdds showed an early trend (Long/Short) before my other indicators all aligned.

So I took that code and put it into a custom watchlist column thinking it would be a better early warning detection.

Not so fast, Bucko. The primary function inside uses ZigZagHighLow that repaints based on previous candle info. Turns out that doesn't work in a custom column for a watchlist.

Does anyone know of a similar function that does not repaint? I am not trading directly from it, but would like to use it to identify candidate stocks in a watchlist that can be quickly opened in the analysis window where I can evaluate the other indicators to make a trading decision.

Ideally, when the condition is met, the background cell in the watchlist will change colors and stay that same color until the next trigger event.

Any direction and help will be appreciated.

Here is the code from the watchlist custom column:
Code:
Here is the code from the watchlist custom column:
# AsGoodAsItGets Indicator without Arrows
#CSR Buy/Sell Arrows with Short/Long Bubbles
#Developed 4-9-22 First Edition 8-23-22 Revised
#No Arrow Edition 1/1/23

input atrreversal = 2.0;

def priceh = MovingAverage(AverageType.EXPONENTIAL, high, 5);
def pricel = MovingAverage(AverageType.EXPONENTIAL, low, 5);

def EIL = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastL;
def EIH = ZigZagHighLow("price h" = priceh, "price l" = pricel, "percentage reversal" = .01, "absolute reversal" = .05, "atr length" = 5, "atr reversal" = atrreversal).lastH;

def signalDown = !IsNan(EIH);
def sigRevBot = !IsNan(EIL);

plot pcol = 0;

AssignBackgroundColor(
if signalDown then color.red
else if sigRevBot then color.green
else color.blue);

The plotting of a 0 and the blue background are being used for debugging.
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
2093 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top