Repaints AccDist /w Stochastic boundaries + CCI Extremes Strategy

Repaints

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

Not to hijack the OP thread but I took a liking to jnitro version, however, it is plagued with repaints and 3 bars late. The general census shows interest in the direction of swing trades at a lower time frame. For example on 11/27/2020 opening for PLTR showed interest for a short side around 5:30 am printing on 4:45 am candle and disappear once price rise above it. It happened a few times until the price decided to flip direction. I would thread carefully with breakeven stop losses.
 
Not to hijack the OP thread but I took a liking to jnitro version, however, it is plagued with repaints and 3 bars late. The general census shows interest in the direction of swing trades at a lower time frame. For example on 11/27/2020 opening for PLTR showed interest for a short side around 5:30 am printing on 4:45 am candle and disappear once price rise above it. It happened a few times until the price decided to flip direction. I would thread carefully with breakeven stop losses.
Yes, I noticed the same thing. Also, if u are backtesting on say 15 min 5 days & change the duration of the time to 15 mins 10 day or 15 mins 30 days it will give u almost completely different signals.

I think this is because its calculating based on "screen view" / Time duration selected 15 mins 30 days vs 15 days. One way to perhaps tackle this problem would be having a fixed lookback period ex 252 bars
 
on friday, i used a screen recording program to record the day as it unfolded for TQQQ using the strategy here, then i watched it using the VLC media player and did so on like 60x, so the trading day went by PDQ. pretty interesting to see the buy signals come and go, come and go. a little dispiriting, too, given how moderately high my hopes were. ah well. btw / i had it set for 5 min / today. if ya'll are interested in seeing if a strategy repaints, it's super easy to do the recording. i used a free open-source program called OBS Studio. did all the recording in the background while i went about my day.
 
The strategy performed admirably on TQQQ today, with nary a repaint. got in near the low and was still holding at the bell, up around 4.5% on the day. wish i had money in it for real but nope, not this time.

Love how the entry dovetailed with my other favorite indicator, DIPlus 5 / ADX 3.

update: it closed the position an hour and some into afterhours, for a total win of 5.04%.
 
Last edited:
Hi,
How do you include the AcctDist_LinReg into the watchlist?
I've tried copy/paste the code, but the values didn't come up right.
I'm not sure what went wrong.
Thanks
 
for fun, i recorded a few hours of the indicator at work, then compressed everything into a fast version, five or so minutes long. signals worth looking at are noted below.


0:11 -- goes long
1:00 - exits long
1:12 -- the earlier long signal disappears as does the exit
1:15 -- both briefly reappear.
1:28 -- new long signal
5:13 -- long signal flashes on and off.
5:15 -- long signal disappears and that's where i stopped the exercise.

this was about 3 or four hours worth of real time action. as much as i want to love the indicator, i just don't see how to use it.

setting was 5 minutes, today only.

thoughts?
 

0:11 -- goes long
1:00 - exits long
1:12 -- the earlier long signal disappears as does the exit
1:15 -- both briefly reappear.
1:28 -- new long signal
5:13 -- long signal flashes on and off.
5:15 -- long signal disappears and that's where i stopped the exercise.

this was about 3 or four hours worth of real time action. as much as i want to love the indicator, i just don't see how to use it.

setting was 5 minutes, today only.

thoughts?
 
I would advise the author of this post to put caution on this post. As the video showed earlier post, this thing will repaint to always look good no matter what. When I tested it, it went back 82 bars back to repaint.
 
Warning: This is a repainting indicator/strategy. Proceed with caution.

So I keep coming back to the AccDist (with Stochastic) and the AccDist (with Linear Regression) and I'm starting to really like it.
The original idea came from a post thread that begins here: https://usethinkscript.com/threads/a-wonderful-simple-top-and-bottom-intraday-signal.1981/ and
I posted something awhile back here: https://usethinkscript.com/threads/a-wonderful-simple-top-and-bottom-intraday-signal.1981/post-39357

So I've patched together a little strategy that finds excellent entries and definitely successful exits... but not optimal exits. I'm hoping that others might jump in and start a dialog about how to optimize exits. What I did was combine the AccDist_Stochastic indicator with a CCI_Extremes indicator (which basically just signals when CCI has hit +200 or -200....which are often reversal or retracement points).

Note: I've come to the conclusion that with either of the AccDist indicators, displaying them on charts with multiple days can be deceiving. Meaning that the indicator may display wonderful tops and bottoms on, let's say, a 5min/10 day chart, but when those days were happening in real time, the signals may not have been there. The indicator is fickle that way. So, my conclusion is this: use this only on a "today" chart, meaning 3min:Today, 5min:Today, 10min:Today, 15min:Today and so on.

A lot of the entries happen after market closes/reopens, overnight and quite often 1-2 hrs before market open.

I didn't note original authors in the script, so let me say that all credit goes to @BillMurray , @Playstation @horserider , @BenTen , @mashume , @we29125 and others. I was just monkeying around tossing snippets into someone elses code.

I have included a chart layout that has the strategy (2 slightly differerent versions) in side by side charts like the image below. That chart is located here: http://tos.mx/VRj7S2b

Thanks to any and all that jump in.

View attachment 8546
Watch list doesn't work for me. Here is the modified code for WL column. I took the study and tried to create WL column. any help?


declare lower;
input overbought = 1;
input oversold = 0;

def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;

def over_bought = overbought;
def over_sold = oversold;

def AD = TotalSum(data);
plot AccDist = (AD - LowestAll(AD)) / (HighestAll(AD) - LowestAll(AD));
AccDist.SetDefaultColor(GetColor(1));

def stoch1 = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 9, "d period" = 3).SlowD;
#plot SlowD1 = (stoch1 - LowestAll(stoch1)) / (HighestAll(stoch1) - LowestAll(stoch1));
#SlowD1.SetDefaultColor(GetColor(3));

def stoch2 = StochasticSlow("overbought" = 100, "over sold" = 0, "k period" = 5, "d period" = 3).SlowD;
#plot SlowD2 = (stoch2 - LowestAll(stoch2)) / (HighestAll(stoch2) - LowestAll(stoch2));
#SlowD2.SetDefaultColor(GetColor(5));

plot one = 1;
plot zero = 0;
#plot half = 0.5;
input showBreakoutSignals = yes;

def signalup = if AccDist crosses above over_sold then over_sold else Double.NaN within 2 bars;

def signaldown = if AccDist crosses below over_bought then over_bought else Double.NaN within 2 bars;

AssignBackgroundColor(if signalup then color.LiME else if signaldown then color.lIGHT_ORANGE else color.WHITE);

##########################################################
AddLabel(yes, if signalup then "👍" else if signaldown then "👎" else " ", if signaldown then Color.dark_red else if signalup then Color.dark_GREEN else Color.ORANGE);
AssignBackgroundColor(color.light_ORANGE);
############################################################
 
Last edited:
Watch list doesn't work for me. Here is the modified code for WL column. I took the study and tried to create WL column. any help?


declare lower;
input overbought = 1;
input oversold = 0;

def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;

def over_bought = overbought;
def over_sold = oversold;

def AD = TotalSum(data);
plot AccDist = (AD - LowestAll(AD)) / (HighestAll(AD) - LowestAll(AD));
AccDist.SetDefaultColor(GetColor(1));

def stoch1 = StochasticSlow("over bought" = 100, "over sold" = 0, "k period" = 9, "d period" = 3).SlowD;
#plot SlowD1 = (stoch1 - LowestAll(stoch1)) / (HighestAll(stoch1) - LowestAll(stoch1));
#SlowD1.SetDefaultColor(GetColor(3));

def stoch2 = StochasticSlow("overbought" = 100, "over sold" = 0, "k period" = 5, "d period" = 3).SlowD;
#plot SlowD2 = (stoch2 - LowestAll(stoch2)) / (HighestAll(stoch2) - LowestAll(stoch2));
#SlowD2.SetDefaultColor(GetColor(5));

plot one = 1;
plot zero = 0;
#plot half = 0.5;
input showBreakoutSignals = yes;

def signalup = if AccDist crosses above over_sold then over_sold else Double.NaN within 2 bars;

def signaldown = if AccDist crosses below over_bought then over_bought else Double.NaN within 2 bars;

AssignBackgroundColor(if signalup then color.LiME else if signaldown then color.lIGHT_ORANGE else color.WHITE);

##########################################################
AddLabel(yes, if signalup then "👍" else if signaldown then "👎" else " ", if signaldown then Color.dark_red else if signalup then Color.dark_GREEN else Color.ORANGE);
AssignBackgroundColor(color.light_ORANGE);
############################################################

Sadly, you are correct.
Repainters should not be used in scans, watchlists, or conditional orders
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
357 Online
Create Post

Similar threads

Similar threads

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