Can someone PLEASE help me make this Indicator. It’s a true game changer.

TipsyTrader

New member
I don’t know if I’m retarded but I’ve been browsing the thinkscript code trying to grasp how to make the indicator I want but I’m not getting it. if someone could please make this indicator for me, I’d be eternally grateful. If we can make this, it‘ll be extremely useful in your own trading for sure.

The basis of this indicator is to analyze and compare extensions versus their pullbacks by price range, volume and the labeling of certain candles. This would effectively show which side of the market has strength and which has weakness.

First step
-Definition of an extension and pullback-
An extension is two or more bullish or bearish candlesticks in a row. An extension can include one bar in the opposite direction.
-Pullback- two or more candlesticks in the opposite direction of the extension.
Second step
-Add up the volume total for the extension
-Add up the volume total for the PB
-Compare the volume as a %, extension compared to PB
Third step
-Find the total movement of price from the low of the first candle to the high of the last candle in the extension
-Do the same for the PB
-Compare how far price retraced the extension as a %, extension compared to PB
Fourth step
-Compare the volume and distance price travelled during the most recent extension and PB to the previous extension & PB if they occurred in the same direction. Compare extension to extension, PB to PB as well as the retraced % and volume %
Step Five
-Categorize the volume of each extension and PB as either Confirming, Anomaly, Stopping, Topping Or (Exhaustion/Strength)
-Confirming - If volume increased consecutively for 3 or more candlesticks.
-Stopping - Two ifs to qualify 1) if the bears were in control of the last extension, the first candle of its PB should be atleast 75% of the previous candles volume. 2) The next candlesticks volume has to be lower than the first candles.
-Topping - Two if’s to qualify 1) if the bulls were in control of the last extension, the first candle of its PB has to be atleast 75% of the previous candles volume 2) The next candlesticks volume has to be lower than the first candles.
-Anomaly - A few scenarios qualify as an anomaly but first we need to define it - select from 3 timeframes, previous day, previous week, previous month. Maybe an option to pick between sessions would work better, UK, US, Tokyo. Then find the average price range and average volume of each candlestick as a base.
Scenarios for anomaly label
If the current candlestick is above the average in range but below in volume avg =anomaly
if the current candlestick is above average in volume but below in range avg = anomaly
If a single bearish candle forms during a bullish extension =anomaly
if a single bullish candle forms during a bearish extension =anomaly
if during a 3 candlestick extension the middle candle has lower volume than the first and third candle =anomaly
-Exhaustion/Strength - Two If‘s to qualify 1) Only during an extension that is 4 or more candles 2) The 4th or beyond candlestick can be labeled as such if the volume from that candle is 50% or more than its previous candle in the same direction of the extension
Step Six
Label select candlesticks as Whales if certain conditions are met.
1) If it’s the first candlestick in a PB 2) Meets the condition to be labeled as Stopping or Topping volume. And meets at-least one of the following conditions. 1) It engulfs the previous candles body by at-least 80%. 2) Is 2x or more the price range & volume of the previous candle

If the condition for an extension isn’t present then the current candle or group of candles will be labeled balanced.

That’s the basics of the indicator I want to make and would love help from someone who actually knows what they’re doing. It’ll definitely need some fine tuning but please can someone help me out??
 
may i suggest that if people are going to work on this, that they make a post stating which section. then when they have something, they edit their post and add in their code.
i don't know when i will get back to this.

i don't think you realize how involved this study will be.
i put some time into it and only have the first half of step 1 done, identifying extension series of bars.

a bull series starts with a bull candle. a bear series starts with a bear candle.
1 of the opposite candles is allowed in the series.
doji bars ( 0 body height) are counted as a valid bar in the series.


bullstart , has the barnumber of candle, if candle is the start of a bull series, else it is 0
bullstop , has the barnumber of candle, if candle is the stop of a bull series, else it is 0
bullseries , has numbers greater than 0 if candle is part of a bull series

bearstart , same as bull variables
bearstop ,
bearseries ,

here is my code for finding extensions, a collection of bars with most of them going the same direction.
it is sloppy and has a lot of commented debugging code, but i thinks it works as i described, and may be a starting point.
i copied the code description the OP typed up, and inserted code under step 1.

Ruby:
# extensions_pullbacks_00d



# https://usethinkscript.com/threads/can-someone-please-help-me-make-this-indicator-it%E2%80%99s-a-true-game-changer.7184/

# Can someone PLEASE help me make this Indicator. It’s a true game changer.
# TipsyTrader   7/14/21

# The basis of this indicator is to analyze and compare extensions versus their pullbacks by price range, volume and the labeling of certain candles.
# This would effectively show which side of the market has strength and which has weakness.



#def lastbar = HighestAll(If(IsNaN(c), 0, bn));

#First step
#-Definition of an extension and pullback-
#An extension is two or more bullish or bearish candlesticks in a row. An extension can include one bar in the opposite direction.
#-Pullback- two or more candlesticks in the opposite direction of the extension.


# -----------------------------------
# halcyonguy
# 21-07-14
# i decided to make the minimum series quantity to be 3. i didn't want to look for 2 bar patterns. it would require more formulas to check for valid data.
# if you want a minimum of 2 bars of the same direction, and it is permissable to have 1 bar being opposite, that would be 3.

def na = double.nan;
def bn = barnumber();
def o = open;
def h = high;
def l = low;
def c = close;

def bullbar = (c > o);
def bearbar = (c < o);

# =====================
# bull

#addchartbubble(1, h*1.0004, bullbar, color.gray, yes);

#def bullsum = sum(bullbar[-2], 3);
#input test_show_sums = no;
#plot z1 = if test_show_sums then bullsum else na;
#z1.SetPaintingStrategy(PaintingStrategy.VALUES_below);
#z1.SetDefaultColor(Color.cyan);


# find the start of bull series. 2 of 3 are bull. prev bar not a bull
def bullstart1 = if bullbar and (sum(bullbar[-2], 3) >= 2 and !bullstart1[1] and !bullstart1[2] and !bullbar[1]) then bn else 0;


# multiple 3 bar series may exist in main series
#input show_wedge_3bar_series_start = no;
#plot z3 = if show_wedge_3bar_series_start then (bullstart1 > 0) else na;
#z3.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_up);
#z3.SetDefaultColor(Color.green);
#z3.setlineweight(4);
#z3.hidebubble();


#input test_show_start_bn = no;
#plot z5 = if test_show_start_bn and bullstart1 > 0 then bullstart1 else na;
#z5.SetPaintingStrategy(PaintingStrategy.VALUES_below);
#z5.SetDefaultColor(Color.cyan);

def bullseries = if bn == 1 then 0
 else if ( bullstart1 > 0 and bullseries[1] == 0 ) then 1
 else if ( bearbar[0] and bullseries[1] == 2 ) then 0
 else if ( bearbar and bullseries[1] > 0 ) then bullseries[1] + 1
 else bullseries[1];

#  last bar of bull series
def bullstop = if (bullseries[0] == 2 and bullseries[-1] == 0) then bn else 0;

def bullstart = if ( bullseries == 1 and bullseries[1] == 0 ) then bn else 0;

# count of opposites + 1
#addchartbubble(1, low, bullstop1, (if bullstop1 > 0 then color.green else color.gray), no);
# bull stop bn
#addchartbubble(1, low, bullstop, (if bullstop > 0 then color.blue else color.gray), no);


input show_wedge_bullseries_startstop = yes;
#  first bar of bull series
plot z7 = if (show_wedge_bullseries_startstop and bullstart > 0) then 1 else na;
z7.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_up);
z7.SetDefaultColor(Color.green);
z7.setlineweight(4);
z7.hidebubble();

#  last bar of bull series
plot z8 = if (show_wedge_bullseries_startstop and bullstop > 0 ) then 1 else na;
z8.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_up);
z8.SetDefaultColor(Color.blue);
z8.setlineweight(4);
z8.hidebubble();


input show_wedges_on_bull_series = no;
plot z9 = if (show_wedges_on_bull_series and bullseries > 0) then 1 else na;
z9.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_up);
z9.SetDefaultColor(Color.green);
z9.setlineweight(4);
z9.hidebubble();


input show_line_on_bull_series = yes;
plot z10 = if (show_line_on_bull_series and bullseries > 0) then (high * 1.001) else na;
z10.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
z10.SetDefaultColor(Color.green);
z10.setlineweight(2);
z10.hidebubble();



# =====================
# bear

#addchartbubble(1, l*0.9996, bearbar, color.gray, no);

# find the start of bear series. 2 of 3 are bear. prev bar not a bear
def bearstart1 = if bearbar and (sum(bearbar[-2], 3) >= 2 and !bearstart1[1] and !bearstart1[2] and !bearbar[1]) then bn else 0;



def bearseries = if bn == 1 then 0
 else if ( bearstart1 > 0 and bearseries[1] == 0 ) then 1
 else if ( bullbar[0] and bearseries[1] == 2 ) then 0
 else if ( bullbar and bearseries[1] > 0 ) then bearseries[1] + 1
 else bearseries[1];

#  last bar of bull series
def bearstop = if (bearseries[0] == 2 and bearseries[-1] == 0) then bn else 0;

def bearstart = if ( bearseries == 1 and bearseries[1] == 0 ) then bn else 0;



input show_wedge_bearseries_startstop = yes;
#  first bar of bull series
plot z11= if (show_wedge_bearseries_startstop and bearstart > 0) then 1 else na;
z11.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_down);
z11.SetDefaultColor(Color.red);
z11.setlineweight(4);
z11.hidebubble();

#  last bar of bull series
plot z12 = if (show_wedge_bearseries_startstop and bearstop > 0 ) then 1 else na;
z12.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_down);
z12.SetDefaultColor(Color.yellow);
z12.setlineweight(4);
z12.hidebubble();

input show_wedges_on_bear_series = no;
plot z13 = if (show_wedges_on_bear_series and bearseries > 0) then 1 else na;
z13.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_down);
z13.SetDefaultColor(Color.red);
z13.setlineweight(4);
z13.hidebubble();


input show_line_on_bear_series = yes;
plot z14 = if (show_line_on_bear_series and bearseries > 0) then (low * 0.999) else na;
z14.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
z14.SetDefaultColor(Color.red);
z14.setlineweight(2);
z14.hidebubble();







# x.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
# x.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
# x.SetDefaultColor(Color.red);
# x.SetStyle(Curve.MEDIUM_DASH);
# x.setlineweight(1);
# x.hidebubble();





# def extcnt = if bn == 1 then 0    else if






#Second step
#-Add up the volume total for the extension
#-Add up the volume total for the PB
#-Compare the volume as a %, extension compared to PB

#Third step
#-Find the total movement of price from the low of the first candle to the high of the last candle in the extension
#-Do the same for the PB
#-Compare how far price retraced the extension as a %, extension compared to PB

#Fourth step
#-Compare the volume and distance price travelled during the most recent extension and PB to the previous extension & PB if they occurred in the same direction. Compare extension to extension, PB to PB as well as the retraced % and volume %

#Step Five
#-Categorize the volume of each extension and PB as either Confirming, Anomaly, Stopping, Topping Or (Exhaustion/Strength)
#-Confirming - If volume increased consecutively for 3 or more candlesticks.
#-Stopping - Two ifs to qualify 1) if the bears were in control of the last extension, the first candle of its PB should be atleast 75% of the previous candles volume. 2) The next candlesticks volume has to be lower than the first candles.
#-Topping - Two if’s to qualify 1) if the bulls were in control of the last extension, the first candle of its PB has to be atleast 75% of the previous candles volume 2) The next candlesticks volume has to be lower than the first candles.
#-Anomaly - A few scenarios qualify as an anomaly but first we need to define it - select from 3 timeframes, previous day, previous week, previous month. Maybe an option to pick between sessions would work better, UK, US, Tokyo. Then find the average price range and average volume of each candlestick as a base.
#Scenarios for anomaly label
#If the current candlestick is above the average in range but below in volume avg =anomaly
#if the current candlestick is above average in volume but below in range avg = anomaly
#If a single bearish candle forms during a bullish extension =anomaly
#if a single bullish candle forms during a bearish extension =anomaly
#if during a 3 candlestick extension the middle candle has lower volume than the first and third candle =anomaly
#-Exhaustion/Strength - Two If‘s to qualify 1) Only during an extension that is 4 or more candles 2) The 4th or beyond candlestick can be labeled as such if the volume from that candle is 50% or more than its previous candle in the same direction of the extension

#Step Six
#Label select candlesticks as Whales if certain conditions are met.
#1) If it’s the first candlestick in a PB 2) Meets the condition to be labeled as Stopping or Topping volume. And meets at-least one of the following conditions. 1) It engulfs the previous candles body by at-least 80%. 2) Is 2x or more the price range & volume of the previous candle

#If the condition for an extension isn’t present then the current candle or group of candles will be labeled balanced.

#That’s the basics of the indicator I want to make and would love help from someone who actually knows what they’re doing. It’ll definitely need some fine tuning but please can someone help me out??


addlabel(1, "extensions_pullbacks_01" , color.cyan);


# x.SetPaintingStrategy(PaintingStrategy.BOOLEAN_wedge_down);
# x.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
# x.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
# x.SetDefaultColor(Color.red);
# x.SetStyle(Curve.MEDIUM_DASH);
# x.setlineweight(1);
# x.hidebubble();

j8JEZNN.jpg
 
Last edited:
I took a look at what you have on my chart and it seems the 3 series quantity looks like it’ll play nicely. We need to tweak the extensions & PB‘s a little though. Maybe if we add another condition to them like if any of the next candles in a series closes above the previous candle that series ends. Do you think that’s Doable? We don’t need to include every candle on the chart into a series. Also I can’t figure out for the life of me how each series picks where it begins. Do you think you could give it a start time? Like at the NYSE open? Then have it reset at the next open. This way we won’t have any close to open series are on the chart. Idk if that makes sense but thanks again man. I’m not trying to be a pain in the ***. 😆
 
your not a pain. ask all the questions you want. chances are good that myself or someone will try to help.

>I took a look at what you have on my chart and it seems the 3 series quantity looks like it’ll play nicely.
good. i didn't want to start a series with 1 bar, then stop it after 2 , when the 2nd and 3rd bar went opposite.

>We need to tweak the extensions & PB‘s a little though. Maybe if we add another condition to them like,
> if any of the next candles in a series closes above the previous candle that series ends.
yes, if a formula can be created to solve a question. something like ( close > high[1] )
i usually don't question what someone wants, i just like trying to solve a problem with some programming. but this doesn't make any sense to me. if you want to find bullish bars , why wouldn't you want to include the ones that gap up?

>We don’t need to include every candle on the chart into a series.
i don't understand this. how/when would you restrict them? some time period of the day? only the current day ?

>Also I can’t figure out for the life of me how each series picks where it begins. Do you think you could give it a start time? Like at the NYSE open? Then have it reset at the next open. This way we won’t have any close to open series are on the chart. Idk if that makes sense but thanks again man. I’m not trying to be a pain in the ***.
where a series starts? there are lines and shapes, above and below the bars, that show where the series starts and stops. studies > edit studies > change some inputs to yes to turn them on.

i think so. you don't want any series occuring over after hours?
 
yes, if a formula can be created to solve a question. something like ( close > high[1] )
i usually don't question what someone wants, i just like trying to solve a problem with some programming. but this doesn't make any sense to me. if you want to find bullish bars , why wouldn't you want to include the ones that gap up?
haha no no, I didn’t mean it like that. I meant for a bullish series if price closed lower than the previous bars close. That series would end and the next would begin. For a bearish series if price for the current bar closed higher than the previous, that series would end.
 
where a series starts? there are lines and shapes, above and below the bars, that show where the series starts and stops. studies > edit studies > change some inputs to yes to turn them on.

i think so. you don't want any series occuring over after hours?
I’m not great at explaining things lol. I meant how you defined where a series starts and stops. But I don’t want to exclude the overnight, I was just thinking to have the indicator ”reset“ itself to at the US open in regards to the start of a series Or something like this so the indicator doesn’t try to include an overnight gap in a seriEs when analyzing stocks.
 
Can I ask how hard it would be to make an indicator that allowed the user to select a beginning and an end for a series? Would that make this indicator easier to make or harder? Seems like it would be more difficult?
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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