Premarket Pivot Indicator

Solution
Is there any Pivot Indicator on the Forum that uses only Premarket data?

Is it possible to create a Pivot Indicator based on Premarket data only from any of the existing forum pivot studies??
https://usethinkscript.com/search/1322642/?q=pivot*&t=post&c[child_nodes]=1&c[nodes][0]=3&c[title_only]=1&o=replies&g=1

@FutureTony @SleepyZ @Svanoy
@halcyonguy

i think this is correct...
i used svepivot code

Code:
# pre_pivots

#https://usethinkscript.com/threads/premarket-pivot-indicator.16829/
# Premarket Pivot Indicator

def bn = BarNumber();
def na = Double.NaN;

def diffday = GetDay() != GetDay()[1];
def lastday = GetDay() != GetLastDay();

# open/close times  (EST)
input...
Is there any Pivot Indicator on the Forum that uses only Premarket data?

Is it possible to create a Pivot Indicator based on Premarket data only from any of the existing forum pivot studies??
https://usethinkscript.com/search/1322642/?q=pivot*&t=post&c[child_nodes]=1&c[nodes][0]=3&c[title_only]=1&o=replies&g=1

@FutureTony @SleepyZ @Svanoy
@halcyonguy

i think this is correct...
i used svepivot code

Code:
# pre_pivots

#https://usethinkscript.com/threads/premarket-pivot-indicator.16829/
# Premarket Pivot Indicator

def bn = BarNumber();
def na = Double.NaN;

def diffday = GetDay() != GetDay()[1];
def lastday = GetDay() != GetLastDay();

# open/close times  (EST)
input prestart = 0100;
input preend = 0930;
input daystart = 0930;
input dayend = 1600;

def ispre = if SecondsFromTime(prestart) >= 0 and SecondsTillTime(preend) > 0 then 1 else 0;
def isday = if SecondsFromTime(daystart) >= 0 and SecondsTillTime(dayend) > 0 then 1 else 0;

def prefirst = !ispre[1] and ispre;

def preopen = if bn == 1 then na
 else if prefirst then open
 else preopen[1];

def prehigh = if bn == 1 then na
 else if prefirst then high
 else if ispre then Max(high, prehigh[1])
 else prehigh[1];

def prelow = if bn == 1 then na
 else if prefirst then low
 else if ispre then Min(low, prelow[1])
 else prelow[1];

def preclose = if bn == 1 then na
 else if ispre and !ispre[-1] then close
 else preclose[1];

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

def ph = if isday then prehigh else na;
def pl = if isday then prelow else na;
def pc = if isday then preclose else na;

# svepivots

plot R3;
plot R2;
plot R1;
plot PP;
plot S1;
plot S2;
plot S3;

plot R3M;
plot R2M;
plot R1M;
plot HH;
plot LL;
plot S1M;
plot S2M;
plot S3M;

HH = PH;
LL = PL;
PP = (PH + PL + PC) / 3;
R1 = 2 * PP - PL;
R1M = (R1 - PP) / 2 + PP;
R2 = PP + (PH - PL);
R2M = (R2 - R1) / 2 + R1;
R3 = 2 * PP + (PH - 2 * PL);
R3M = (R3 - R2) / 2 + R2;
S1 = 2 * PP - PH;
S1M = (PP - S1) / 2 + S1;
S2 = PP - (PH - PL);
S2M = (S1 - S2) / 2 + S2;
S3 = 2 * PP - (2 * PH - PL);
S3M = (S2 - S3) / 2 + S3;


R3.SetDefaultColor(GetColor(5));
R3M.SetDefaultColor(GetColor(5));
R2.SetDefaultColor(GetColor(5));
R2M.SetDefaultColor(GetColor(5));
R1.SetDefaultColor(GetColor(5));
R1M.SetDefaultColor(GetColor(5));
HH.SetDefaultColor(GetColor(4));
PP.SetDefaultColor(GetColor(0));
LL.SetDefaultColor(GetColor(1));
S1.SetDefaultColor(GetColor(6));
S1M.SetDefaultColor(GetColor(6));
S2.SetDefaultColor(GetColor(6));
S2M.SetDefaultColor(GetColor(6));
S3.SetDefaultColor(GetColor(6));
S3M.SetDefaultColor(GetColor(6));

R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
HH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
LL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R3M.SetStyle(Curve.SHORT_DASH);
R2M.SetStyle(Curve.SHORT_DASH);
R1M.SetStyle(Curve.SHORT_DASH);
HH.SetStyle(Curve.MEDIUM_DASH);
LL.SetStyle(Curve.MEDIUM_DASH);
S1M.SetStyle(Curve.SHORT_DASH);
S2M.SetStyle(Curve.SHORT_DASH);
S3M.SetStyle(Curve.SHORT_DASH);

R3M.Hide();
R2M.Hide();
R1M.Hide();
HH.Hide();
LL.Hide();
S1M.Hide();
S2M.Hide();
S3M.Hide();
#
 
Solution
This is perfect @halcyonguy! Thank you so much


@MerryDay thank you for your help as well in getting me to the right place for this question




i think this is correct...
i used svepivot code

Code:
# pre_pivots

#https://usethinkscript.com/threads/premarket-pivot-indicator.16829/
# Premarket Pivot Indicator

def bn = BarNumber();
def na = Double.NaN;

def diffday = GetDay() != GetDay()[1];
def lastday = GetDay() != GetLastDay();

# open/close times  (EST)
input prestart = 0100;
input preend = 0930;
input daystart = 0930;
input dayend = 1600;

def ispre = if SecondsFromTime(prestart) >= 0 and SecondsTillTime(preend) > 0 then 1 else 0;
def isday = if SecondsFromTime(daystart) >= 0 and SecondsTillTime(dayend) > 0 then 1 else 0;

def prefirst = !ispre[1] and ispre;

def preopen = if bn == 1 then na
 else if prefirst then open
 else preopen[1];

def prehigh = if bn == 1 then na
 else if prefirst then high
 else if ispre then Max(high, prehigh[1])
 else prehigh[1];

def prelow = if bn == 1 then na
 else if prefirst then low
 else if ispre then Min(low, prelow[1])
 else prelow[1];

def preclose = if bn == 1 then na
 else if ispre and !ispre[-1] then close
 else preclose[1];

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

def ph = if isday then prehigh else na;
def pl = if isday then prelow else na;
def pc = if isday then preclose else na;

# svepivots

plot R3;
plot R2;
plot R1;
plot PP;
plot S1;
plot S2;
plot S3;

plot R3M;
plot R2M;
plot R1M;
plot HH;
plot LL;
plot S1M;
plot S2M;
plot S3M;

HH = PH;
LL = PL;
PP = (PH + PL + PC) / 3;
R1 = 2 * PP - PL;
R1M = (R1 - PP) / 2 + PP;
R2 = PP + (PH - PL);
R2M = (R2 - R1) / 2 + R1;
R3 = 2 * PP + (PH - 2 * PL);
R3M = (R3 - R2) / 2 + R2;
S1 = 2 * PP - PH;
S1M = (PP - S1) / 2 + S1;
S2 = PP - (PH - PL);
S2M = (S1 - S2) / 2 + S2;
S3 = 2 * PP - (2 * PH - PL);
S3M = (S2 - S3) / 2 + S3;


R3.SetDefaultColor(GetColor(5));
R3M.SetDefaultColor(GetColor(5));
R2.SetDefaultColor(GetColor(5));
R2M.SetDefaultColor(GetColor(5));
R1.SetDefaultColor(GetColor(5));
R1M.SetDefaultColor(GetColor(5));
HH.SetDefaultColor(GetColor(4));
PP.SetDefaultColor(GetColor(0));
LL.SetDefaultColor(GetColor(1));
S1.SetDefaultColor(GetColor(6));
S1M.SetDefaultColor(GetColor(6));
S2.SetDefaultColor(GetColor(6));
S2M.SetDefaultColor(GetColor(6));
S3.SetDefaultColor(GetColor(6));
S3M.SetDefaultColor(GetColor(6));

R3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
R1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
HH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
LL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S1M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S2M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
S3M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

R3M.SetStyle(Curve.SHORT_DASH);
R2M.SetStyle(Curve.SHORT_DASH);
R1M.SetStyle(Curve.SHORT_DASH);
HH.SetStyle(Curve.MEDIUM_DASH);
LL.SetStyle(Curve.MEDIUM_DASH);
S1M.SetStyle(Curve.SHORT_DASH);
S2M.SetStyle(Curve.SHORT_DASH);
S3M.SetStyle(Curve.SHORT_DASH);

R3M.Hide();
R2M.Hide();
R1M.Hide();
HH.Hide();
LL.Hide();
S1M.Hide();
S2M.Hide();
S3M.Hide();
#
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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