Recreate opening tick indicator for ToS?

BenTen

BenTen

Administrative
Staff
VIP
So, sort of like plotting the stock's opening price, but instead, you plot the opening tick as in Tick chart?
 
T

tabs999

Member
yeah exactly its just like a stocks opening price its basically the exact same concept, the line is drawn on the open price of whatever instrument doesn't necessarily have to based only on a tick chart Just the price the instrument opened at.
 
BenTen

BenTen

Administrative
Staff
VIP
@tabs999 Here you go:

Code:
# Opening Price Indicator
# Assembled by BenTen at UseThinkScript.com

input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);

plot opening_price = open;
opening_price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
opening_price.SetDefaultColor(Color.UPTICK);
 
T

tabs999

Member
Ty Sir for your contribution its a good level to have eyes on can you add a manual aggregation time for testing out of different opens ? if need be like say 9:00am
 
Piper792

Piper792

New member
@BenTen - Can this be coded for the 9:30 opening RTH each day for Futures traders? Otherwise, it plots the 1800est Sunday open as these are 24/5 markets
 
BenTen

BenTen

Administrative
Staff
VIP
@Piper792 You can disable extended hours from the chart's settings.
 
Piper792

Piper792

New member
Thanks. What would the code be to add to this for the current day only?
 
Last edited by a moderator:
BenTen

BenTen

Administrative
Staff
VIP
@Piper792 Updated code:

Code:
# Opening Price Indicator
# Assembled by BenTen at UseThinkScript.com

input ShowTodayOnly = yes;
def Today = if GetDay() == GetLastDay() then 1 else 0;
input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);

plot opening_price = if ShowTodayOnly and !Today then Double.NaN else open;
opening_price.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
opening_price.SetDefaultColor(Color.UPTICK);
 
Top