the one-two punch scan or the script

TVA

New member
VIP
Hello, can someone point me to the one-two punch scan or the script. This one-two punch indicator was used by Ben in a youtube, converting an indicator automated trading
 
Solution
Is this the one?

based on the video in post #2, this
.. draws a dot if ema3 crosses ema8
.. draws arrows if close is outside keltner 3.0 bands

Code:
#one_two_punch
#-------------------------

def na = double.nan;
def bn = BarNumber();

def data = close;
input avg1_type = AverageType.exponential;
input avg1_length = 3;
def avg1 = MovingAverage(avg1_type, data, avg1_length );

input avg2_type = AverageType.exponential;
input avg2_length = 8;
def avg2 = MovingAverage(avg2_type, data, avg2_length );


input show_avg_lines = yes;
plot zavg1 = if show_avg_lines then avg1 else na;
plot zavg2 = if show_avg_lines then avg2 else na;

zavg1.SetDefaultColor(Color.cyan);
zavg1.SetLineWeight(1);
zavg1.HideBubble()...

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

I think it is only supposed to be a technique used to trade their volatility box, and not meant to be a stand alone indicator. I doubt that it would be of any use without the rest of it, if at all.

By itself, it sounds like it is just a series of cheesy ema crossovers. The caveat is that it is supposed to be happening near one of the levels from the main indicator.

The main indicator only contains fixed hard-coded levels. The calculations aren't performed within the script. You have to download weekly updates on a subscription.
 
Is this the one?

based on the video in post #2, this
.. draws a dot if ema3 crosses ema8
.. draws arrows if close is outside keltner 3.0 bands

Code:
#one_two_punch
#-------------------------

def na = double.nan;
def bn = BarNumber();

def data = close;
input avg1_type = AverageType.exponential;
input avg1_length = 3;
def avg1 = MovingAverage(avg1_type, data, avg1_length );

input avg2_type = AverageType.exponential;
input avg2_length = 8;
def avg2 = MovingAverage(avg2_type, data, avg2_length );


input show_avg_lines = yes;
plot zavg1 = if show_avg_lines then avg1 else na;
plot zavg2 = if show_avg_lines then avg2 else na;

zavg1.SetDefaultColor(Color.cyan);
zavg1.SetLineWeight(1);
zavg1.HideBubble();

zavg2.SetDefaultColor(Color.yellow);
zavg2.SetLineWeight(1);
zavg2.HideBubble();

def xup = avg1 crosses above avg2;
def xdwn = avg1 crosses below avg2;

#https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/AverageType
#input avg1_type = AverageType.Simple;
#input avg1_type = AverageType.exponential;
#input avg1_type = AverageType.hull;
#input avg1_type = AverageType.weighted;
#input avg1_type = AverageType.wilders;


AddLabel(1,
(if avg1_type == AverageType.SIMPLE then "SMA"
 else if avg1_type == AverageType.EXPONENTIAL then "EMA"
 else if avg1_type == AverageType.HULL then "HULL"
 else if avg1_type == AverageType.WEIGHTED then "WT"
 else if avg1_type == AverageType.WILDERS then "WILD"
 else "---") + avg1_length
, Color.CYAN);

AddLabel(1,
(if avg2_type == AverageType.SIMPLE then "SMA"
 else if avg2_type == AverageType.EXPONENTIAL then "EMA"
 else if avg2_type == AverageType.HULL then "HULL"
 else if avg2_type == AverageType.WEIGHTED then "WT"
 else if avg2_type == AverageType.WILDERS then "WILD"
 else "---") + avg2_length
, Color.yellow);


#https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/AverageType
#input avg1_type = AverageType.Simple;
#input avg1_type = AverageType.exponential;
#input avg1_type = AverageType.hull;
#input avg1_type = AverageType.weighted;
#input avg1_type = AverageType.wilders;


plot zxup = if xup then high * 1.001 else na;
zxup.SetPaintingStrategy(PaintingStrategy.POINTS);
zxup.SetDefaultColor(Color.cyan);
zxup.setlineweight(3);

plot zxdwn = if xdwn then low * 0.999 else na;
zxdwn.SetPaintingStrategy(PaintingStrategy.POINTS);
zxdwn.SetDefaultColor(Color.cyan);
zxdwn.setlineweight(3);


#------------------------

# keltner ch

input displace = 0;
#input factor = 1.5;
input factor = 3.0;

input length = 20;
input price = close;
input averageType = AverageType.SIMPLE;
input trueRangeAverageType = AverageType.SIMPLE;

def shift = factor * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), length);
def average = MovingAverage(averageType, price, length);

plot Avg = average[-displace];
#Avg.SetDefaultColor(GetColor(1));
avg.SetDefaultColor(Color.white);

plot Upper_Band = average[-displace] + shift[-displace];
#Upper_Band.SetDefaultColor(GetColor(8));
upper_band.SetDefaultColor(Color.gray);

plot Lower_Band = average[-displace] - shift[-displace];
#Lower_Band.SetDefaultColor(GetColor(5));
lower_band.SetDefaultColor(Color.gray);

#----------------------

# is close outside 3.0 keltner bands?
def iskeltlo = close < lower_band;
def iskelthi = close > upper_band;

plot zkup = iskelthi;
zkup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_up);

plot zkdwn = iskeltlo;
zkdwn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_down);

#-----------------
#
 
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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