Recreate opening tick indicator for ToS?

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

Administrative
Staff member
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);
 

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
 

BenTen

Administrative
Staff member
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);
 

Similar threads

Top