Lazy Bear - Scalper's Channel Indicator

Summies88

New member
This is my first post, so bear with me. I have pulled parts of this code info from Lazy Bear - Scalper's Channel (I believe), but I am trying to modify it and can't seem to figure out how to get what I want; if it's even possible.

1. I am trying to make the "Daily High" line stay at the Current Daily High until there is a new Daily High and not go lower. Currently, it will only look back at the previous 20 bars.
2. Want the "Daily Low" line to start at the market open and do the same as the "Daily High" just for the Low.
3. Want the "Scalper Line" to start at market open and be calculated by ((Daily High - Daily Low) * 0.5) + Daily Low. I'm pretty sure I have the portion correct, I just can't get it to start at the market open instead of 20 bars back.

I assume I need to add some sort of YYYYMMDD or GetDay() function I just don't know how to incorporate that into the code and I've searched and played around for about 4 days now trying to figure that out. Any help would be greatly appreciated.

2tzpXIm.png


Code:
declare hide_on_daily;
input Length = 20;


## Daily/Previous Day High/Low ##
#-------------------------------------------------------#
def DayHigh = Highest(data = HIGH, Length);
def PrevDayHigh = DailyHighLow();
def DayLow = Lowest(data = LOW, Length);
def PrevDayLow = DailyHighLow().DailyLow;

plot dh = DayHigh;
dh.SetDefaultColor(color = Color.GREEN);

plot pdh = PrevDayHigh;
pdh.SetDefaultColor(color = Color.DARK_GREEN);
pdh.SetPaintingStrategy(paintingStrategy = PaintingStrategy.DASHES);

plot dl = DayLow;
dl.SetDefaultColor(color = Color.RED);

plot pdl = PrevDayLow;
pdl.SetDefaultColor(color = Color.DARK_RED);
pdl.SetPaintingStrategy(paintingStrategy = PaintingStrategy.DASHES);


## Scalper Line ##
#-------------------------------------------------------#
def DayHighScalper = Highest(data = HIGH);
def DayLowScalper = Lowest(data = LOW);
def dhs = DayHighScalper;
def dls = DayLowScalper;

plot Scalper_Line = ((dhs-dls)*.5)+dls;
Scalper_Line.SetDefaultColor(color.YELLOW);
 
Last edited by a moderator:
This is what I use for AH/PM high and low just change the open and close input and it should work for RTH. globexOpen checks if its RTH so do a plot if for the scalper line. You can change the names around so it makes more sense for your use.

Code:
# TS_GlobexRange
# http://thinkscripter.wordpress.com
# [email protected]
# Last Update 18 JUL 2009

declare once_per_bar;

input Globex_Open = 1620;
input Globex_Close = 0930;

def globexOpen = if(secondsFromTime(Globex_Open) >= 0 or secondsTillTime(Globex_Close)>0, 1, 0);
def globexReset = if globexOpen and !globexOpen[1] then 1 else 0;


rec globexHigh = compoundValue(1, if((high > globexHigh[1] and globexOpen) or globexReset, high,globexHigh[1]),high);
rec globexLow = compoundValue(1, if((low < globexLow[1] and globexOpen) or globexReset, low,globexLow[1]),low);


plot Globex_High = globexHigh;
Globex_high.SetStyle(curve.SHORT_DASH);
Globex_High.SetDefaultColor(color.pink);
Globex_High.SetLineWeight(1);
plot Globex_Low = globexLow;
Globex_Low.SetDefaultColor(color.pink);
Globex_Low.SetLineWeight(1);
 

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

Can you share how to use the scalper channel indicator?

This is what I found as the source of the script, and added some styling.

Code:
declare weak_volume_dependency;
input length = 20;
input factor = 15;

plot scalper_line = Average(close, factor) - Log(Double.Pi * (Average(TrueRange(high,  close,  low),  factor)));
scalper_line.setPaintingStrategy(PaintingStrategy.LINE);
scalper_line.setDefaultColor(Color.MAGENTA);
scalper_line.setLineWeight(3);

plot hi = Highest(high, length);
hi.setPaintingStrategy(PaintingStrategy.LINE);
hi.setDefaultColor(Color.RED);
hi.setLineWeight(1);

plot lo = Lowest(low, length);
lo.setPaintingStrategy(PaintingStrategy.LINE);
lo.setDefaultColor(Color.GREEN);
lo.setLineWeight(1);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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