Need help with Lazy Bear - Scalper's Channel indicator



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.

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;
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.

# TS_GlobexRange
# [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;
plot Globex_Low = globexLow;

Similar threads