Repaints Elliot Wave Indicator for ThinkorSwim

Repaints

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

This would be very interesting. Any help @samer800 when you have time please?
try this ..

CSS:
# Created by Sam4COK@Samer8000 for useThinkScript.com memeber
# 01 / 2023
declare lower;
input src = close;
input sma1length = 5;
input sma2length = 35;
input UsePercent = yes;
input pullbackPer = 38;
input minBarCount = 4;

def na = Double.NaN;
def smadif=if(UsePercent,(Average(src, sma1length) - Average(src, sma2length)) / src * 100, Average(src, sma1length) - Average(src, sma2length));
def col= smadif <= 0;
def BearCount = if col then BearCount[1] + 1 else 0;
def BullCount = if !col then BullCount[1] + 1 else 0;
def barBull = if BullCount==minBarCount then smadif else barBull[1];
def barBear = if BearCount==minBarCount then smadif else barBear[1];

plot minBull = if BUllCount>=minBarCount then barBull - barBull*pullbackPer/100 else na;
minBull.SetDefaultColor(Color.GREEN);
plot maxBEar = if BearCount>=minBarCount then barBear + barBear*pullbackPer/100 else na;
maxBEar.SetDefaultColor(Color.RED);

plot EW = smadif;
EW.AssignValueColor( if col then Color.DARK_RED else Color.DARK_GREEN);
EW.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);


#--- END CODE
 
try this ..

CSS:
# Created by Sam4COK@Samer8000 for useThinkScript.com memeber
# 01 / 2023
declare lower;
input src = close;
input sma1length = 5;
input sma2length = 35;
input UsePercent = yes;
input pullbackPer = 38;
input minBarCount = 4;

def na = Double.NaN;
def smadif=if(UsePercent,(Average(src, sma1length) - Average(src, sma2length)) / src * 100, Average(src, sma1length) - Average(src, sma2length));
def col= smadif <= 0;
def BearCount = if col then BearCount[1] + 1 else 0;
def BullCount = if !col then BullCount[1] + 1 else 0;
def barBull = if BullCount==minBarCount then smadif else barBull[1];
def barBear = if BearCount==minBarCount then smadif else barBear[1];

plot minBull = if BUllCount>=minBarCount then barBull - barBull*pullbackPer/100 else na;
minBull.SetDefaultColor(Color.GREEN);
plot maxBEar = if BearCount>=minBarCount then barBear + barBear*pullbackPer/100 else na;
maxBEar.SetDefaultColor(Color.RED);

plot EW = smadif;
EW.AssignValueColor( if col then Color.DARK_RED else Color.DARK_GREEN);
EW.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);


#--- END CODE
Here is the example in a chart. It looks for the maximum in each bar. Once it finds the highest bar, it takes -38% of the bar and 10%, creating a zone. The requirements to take a maximum or minimum , to create the zone of tolerance of the bullish wave 4.. it must have a minimum of 4 bars it must be greater than 38%, and the oscillator must be positive to create the bearish wave 4 tolerance zone.. it must have a minimum of 4 bars it must be greater -38%, and the oscillator must be negative
 
Here is the example in a chart. It looks for the maximum in each bar. Once it finds the highest bar, it takes -38% of the bar and 10%, creating a zone. The requirements to take a maximum or minimum , to create the zone of tolerance of the bullish wave 4.. it must have a minimum of 4 bars it must be greater than 38%, and the oscillator must be positive to create the bearish wave 4 tolerance zone.. it must have a minimum of 4 bars it must be greater -38%, and the oscillator must be negative
pls test the below.

CSS:
# Created by Sam4COK@Samer8000 for useThinkScript.com memeber
# 01 / 2023
declare lower;
input BarColor = yes;
input ShowCloud = yes;
input src = close;
input sma1length = 5;
input sma2length = 35;
input minZonePer = 10;
input MaxZonePer = 38;
input minBarCount = 4;

def na = Double.NaN;
def pos = Double.POSITIVE_INFINITY;
def neg = Double.NEGATIVE_INFINITY;
script nz {
    input data  = close;
    input repl  = 0;
    def ret_val = if IsNaN(data) then repl else data;
    plot return = ret_val;
}
script fixnan {
    input source = close;
    def fix = if !IsNaN(source) then source else fix[1];
    plot result = fix;
}
def smadif = Average(src, sma1length) - Average(src, sma2length);
def col = smadif <= 0;

def BearCount = if (smadif < 0 and smadif < smadif[1]) then BearCount[1] + 1 else 0;
def BullCount = if (smadif > 0 and smadif > smadif[1]) then BullCount[1] + 1 else 0;
def dirUp;
def dirDn;
def minWaveBear;
def maxWaveBear;
def minWaveBull;
def maxWaveBull;
if BullCount == minBarCount {
    dirUp = yes;
    dirDn = no;
    minWaveBull = smadif * minZonePer / 100;
    maxWaveBull = smadif * -MaxZonePer / 100;
    minWaveBear = 0;
    maxWaveBear = 0;
} else
if BearCount == minBarCount {
    dirUp = no;
    dirDn = yes;
    minWaveBull = 0;
    maxWaveBull = 0;
    minWaveBear = smadif * minZonePer / 100;
    maxWaveBear = smadif * -MaxZonePer / 100;
} else {
    dirUp = if BearCount >= minBarCount then no else dirUp[1];
    dirDn = if BullCount >= minBarCount then no else dirDn[1];
    minWaveBull = if dirUp then minWaveBull[1] else 0;
    maxWaveBull = if dirUp then maxWaveBull[1] else 0;
    minWaveBear = if dirDn then minWaveBear[1] else 0;
    maxWaveBear = if dirDn then maxWaveBear[1] else 0;
}
def barBearmin = if dirDn then if minWaveBear<minWaveBear[1] then minWaveBear else barBearmin[1] else 0;
def barBearmax = if dirDn then if maxWaveBear>maxWaveBear[1] then maxWaveBear else barBearmax[1] else 0;
def barBullmin = if dirUp then if minWaveBull>minWaveBull[1] then minWaveBull else barBullmin[1] else 0;
def barBullmax = if dirUp then if maxWaveBull<maxWaveBull[1] then maxWaveBull else barBullmax[1] else 0;

plot EW = smadif;
EW.AssignValueColor( if col then if smadif < smadif[1] then Color.RED else Color.DARK_RED else
                     if smadif > smadif[1] then Color.GREEN else Color.DARK_GREEN);
EW.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);


plot minBear = barBearmin;
minBear.SetDefaultColor(Color.MAGENTA);
plot maxBear = barBearmax;
maxBear.SetDefaultColor(Color.MAGENTA);

plot minBull = barBullmin;
minBull.SetDefaultColor(Color.CYAN);
plot maxBull = barBullmax;
maxBull.SetDefaultColor(Color.CYAN);


AddCloud(if !ShowCloud then na else if minBull>0 then pos else neg, if minBull>0 then neg else pos, Color.DARK_GREEN, Color.DARK_RED);

AssignPriceColor( if !BarColor then Color.CURRENT else
                  if minBull>0 then if smadif > smadif[1] then Color.GREEN else Color.DARK_GREEN else
                  if smadif < smadif[1] then color.RED else Color.DARK_RED);

#--- END CODE
 
pls test the below.

CSS:
# Created by Sam4COK@Samer8000 for useThinkScript.com memeber
# 01 / 2023
declare lower;
input BarColor = yes;
input ShowCloud = yes;
input src = close;
input sma1length = 5;
input sma2length = 35;
input minZonePer = 10;
input MaxZonePer = 38;
input minBarCount = 4;

def na = Double.NaN;
def pos = Double.POSITIVE_INFINITY;
def neg = Double.NEGATIVE_INFINITY;
script nz {
    input data  = close;
    input repl  = 0;
    def ret_val = if IsNaN(data) then repl else data;
    plot return = ret_val;
}
script fixnan {
    input source = close;
    def fix = if !IsNaN(source) then source else fix[1];
    plot result = fix;
}
def smadif = Average(src, sma1length) - Average(src, sma2length);
def col = smadif <= 0;

def BearCount = if (smadif < 0 and smadif < smadif[1]) then BearCount[1] + 1 else 0;
def BullCount = if (smadif > 0 and smadif > smadif[1]) then BullCount[1] + 1 else 0;
def dirUp;
def dirDn;
def minWaveBear;
def maxWaveBear;
def minWaveBull;
def maxWaveBull;
if BullCount == minBarCount {
    dirUp = yes;
    dirDn = no;
    minWaveBull = smadif * minZonePer / 100;
    maxWaveBull = smadif * -MaxZonePer / 100;
    minWaveBear = 0;
    maxWaveBear = 0;
} else
if BearCount == minBarCount {
    dirUp = no;
    dirDn = yes;
    minWaveBull = 0;
    maxWaveBull = 0;
    minWaveBear = smadif * minZonePer / 100;
    maxWaveBear = smadif * -MaxZonePer / 100;
} else {
    dirUp = if BearCount >= minBarCount then no else dirUp[1];
    dirDn = if BullCount >= minBarCount then no else dirDn[1];
    minWaveBull = if dirUp then minWaveBull[1] else 0;
    maxWaveBull = if dirUp then maxWaveBull[1] else 0;
    minWaveBear = if dirDn then minWaveBear[1] else 0;
    maxWaveBear = if dirDn then maxWaveBear[1] else 0;
}
def barBearmin = if dirDn then if minWaveBear<minWaveBear[1] then minWaveBear else barBearmin[1] else 0;
def barBearmax = if dirDn then if maxWaveBear>maxWaveBear[1] then maxWaveBear else barBearmax[1] else 0;
def barBullmin = if dirUp then if minWaveBull>minWaveBull[1] then minWaveBull else barBullmin[1] else 0;
def barBullmax = if dirUp then if maxWaveBull<maxWaveBull[1] then maxWaveBull else barBullmax[1] else 0;

plot EW = smadif;
EW.AssignValueColor( if col then if smadif < smadif[1] then Color.RED else Color.DARK_RED else
                     if smadif > smadif[1] then Color.GREEN else Color.DARK_GREEN);
EW.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);


plot minBear = barBearmin;
minBear.SetDefaultColor(Color.MAGENTA);
plot maxBear = barBearmax;
maxBear.SetDefaultColor(Color.MAGENTA);

plot minBull = barBullmin;
minBull.SetDefaultColor(Color.CYAN);
plot maxBull = barBullmax;
maxBull.SetDefaultColor(Color.CYAN);


AddCloud(if !ShowCloud then na else if minBull>0 then pos else neg, if minBull>0 then neg else pos, Color.DARK_GREEN, Color.DARK_RED);

AssignPriceColor( if !BarColor then Color.CURRENT else
                  if minBull>0 then if smadif > smadif[1] then Color.GREEN else Color.DARK_GREEN else
                  if smadif < smadif[1] then color.RED else Color.DARK_RED);

#--- END CODE

I made an example here... I drew a Fibonacci retracement to guide you once you had the maximum, the same values are maintained until the same requirements are met again... in the red circle you can see that the condition for a new maximum is not met because it must be greater than -38% one thing I forgot that a maximum of 150 bars if the none condition is not met, the calculation is restarted again.



in this image is how it works
 
Good evening, Its possible to have only Elliot Wave in this script. I was trying but I cant figure out. Thank you!
 
Can someone please assist with an indicator that plots lines on the chart for elliot waves for 1 hr and 4 hr time frames ? i have been searching but couldnt find anything. I am looking for a script code that would draw these lines for any given chart based on the 1 hr and 4 hr time frames. Thanks




1677607789494.png
 
Can someone please assist with an indicator that plots lines on the chart for elliot waves for 1 hr and 4 hr time frames ? i have been searching but couldnt find anything. I am looking for a script code that would draw these lines for any given chart based on the 1 hr and 4 hr time frames. Thanks
Put repainting MTF code on a repainting indicator, no.

The redeeming value of repainting higher highs and lower lows indicators is that there is no lag.
read more: https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-57833

However, putting higher timeframes on a lower timeframe means having to wait for the higher timeframe to close. The wait time, wipes out the value that the repainting indicator had.

For this reason, you will not find a multiple timeframe (MTF) repainting higher highs and lower lows indicator on this forum.
 
I made an example here... I drew a Fibonacci retracement to guide you once you had the maximum, the same values are maintained until the same requirements are met again... in the red circle you can see that the condition for a new maximum is not met because it must be greater than -38% one thing I forgot that a maximum of 150 bars if the none condition is not met, the calculation is restarted again.



in this image is how it works
Hey Jim_Chan, great job on this indicator. I get the premise of Elliott Wave Theory, but is there a better explanation on where to enter/leave a position using this indicator. It's not quite clear, I understand it's trying to find the peaks and troughs of the ElliottWave Oscillator but just need a better explanation of how to use it to identity 1,2,3,4,5 waves and where to enter/exit.
 
Hey Jim_Chan, great job on this indicator. I get the premise of Elliott Wave Theory, but is there a better explanation on where to enter/leave a position using this indicator. It's not quite clear, I understand it's trying to find the peaks and troughs of the ElliottWave Oscillator but just need a better explanation of how to use it to identity 1,2,3,4,5 waves and where to enter/exit.
https://www.investopedia.com/terms/e/elliottwavetheory.asp#:~:text=Wave 2 can’t,Basic Structures."
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
305 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