PreMarket Support/Resist.

S

Steve2286

New member
VIP
Is there an indicator that will draw S&R lines based on premarket hours only and extend them to right? I have the high and low of premarket study.

tks

Steve

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Steve2286 I don't think there is any specific indicator that will draw support and resistance levels just based on pre-market. But you can use any of the existing ones and reduce their lookback period that way it only counts mostly pre-market candles.

 
Last edited:
chenthy

chenthy

New member
VIP
Hi, I have a pre market high and low indicator from Pete Hahn https://www.hahn-tech.com/
It can also alert break of pm high or low.

Not sure it is what you are looking for, but shared anyway.

the study code I modified and used are below:
Code:
#pm_high_low


input alertPeriodStart = 930;
input alertPeriodEnd = 1130;
input alertOnBreak = no;
input alertOnPullBack = no;
input numberOfDays = 2;
input numberOfYears = 0;


def okToPlot = GetLastDay() - numberOfDays <= GetDay() and GetLastYear() - numberOfYears <= GetYear() ;

def startCounter =  SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);

def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;

def regularSessionHours = RegularTradingStart(GetYYYYMMDD()) <= GetTime();
def extendedSessionHours = RegularTradingStart(GetYYYYMMDD()) >= GetTime();

def extendedSessionStart = regularSessionHours[1] and extendedSessionHours;
def regularSessionStart = extendedSessionHours[1] and regularSessionHours;

def extendedSessionHigh = CompoundValue(1, if extendedSessionStart then high else if extendedSessionHours then Max(high, extendedSessionHigh[1]) else extendedSessionHigh[1], high);

def extendedSessionLow = CompoundValue(1, if extendedSessionStart then low else if extendedSessionHours then Min(low, extendedSessionLow[1]) else extendedSessionLow[1],low);

def regularSessionHigh = CompoundValue(1, if regularSessionStart then high else if regularSessionHours then Max(high, regularSessionHigh[1]) else regularSessionHigh[1], 0);

def regularSessionLow = CompoundValue(1, if regularSessionStart then low else if regularSessionHours then Min(low, regularSessionLow[1]) else regularSessionLow[1], 0);


#---------- Plot the overnight high/low during regular market hours
plot overnightHigh =  extendedSessionHigh;
overnightHigh.SetDefaultColor(Color.green);
overnightHigh.SetLineWeight(2);
overnightHigh.SetPaintingStrategy(PaintingStrategy.line);
overnightHigh.SetStyle(curve.firm);
plot overnightLow = extendedSessionLow;
overnightLow.SetDefaultColor(Color.red);
overnightLow.SetLineWeight(2);
overnightLow.SetPaintingStrategy(PaintingStrategy.line);
overnightLow.SetStyle(curve.firm);
 
markos

markos

Well-known member
VIP
Warehouse
Hi, I have a pre market high and low indicator from Pete Hahn https://www.hahn-tech.com/
It can also alert break of pm high or low.
Not sure it is what you are looking for, but shared anyway. Thanks for assisting!
the study code I modified and used are below:
Code:
Hi Chenthy,
When putting code anywhere, please keep the header in tact.  We want to keep up with best practices:

# pm_high_low From Hahn-Tech whatever month and Yr or at least the year.
# V or Version 1.0 - Modified x, y, and z (keep it simple) by Chenthy, January 1st, 2019
# that way every one knows where it came from and what iteration it is. (And it shows respect to Pete Hahn, who has pretty decent stuff)

input alertPeriodStart = 930;....
overnightLow.SetPaintingStrategy(PaintingStrategy.line);
overnightLow.SetStyle(curve.firm);
Hi Chenthy,
When putting code anywhere, please keep the header in tact. We want to keep up with best practices:

# pm_high_low From Hahn-Tech whatever month and Yr or at least the year.
# V or Version 1.0 - Modified x, y, and z (keep it simple) by Chenthy, January 1st, 2019
# that way every one knows where it came from and what iteration it is. (And it shows respect to Pete Hahn, who has pretty decent stuff)

PS, IMO, Try to never buy an indicator. As you've seen here, @BenTen and crew, you included, are building a helpful place for indicators.
Assisting however we can! ☺

Thanks for sharing! Markos
 

Top