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:

generic

Active member
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);
 

barbaros

Well-known member
VIP
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

Top