Thursday, November 13, 2008

thinkScript - Current Day's Opening Price


This study will plot the current day's open price at 8:30am CT. This will only work if you are using a time aggregation period of less than 1 hour, i.e. 30min, 15min, 5min, etc...

Also, note that the open price of the 8:30am CT bar may not be the same as the actual OPEN quote.

The inputs will allow you to select your own market open time (based on Eastern Time and on a 24 hour format) and the price input will allow you to select which price you wish to chart, i.e. open, high, low, close...

It will NOT work with tick charts!

!!!! FOR EDUCATIONAL PURPOSES ONLY - PLEASE READ DISCLAIMER POST!!!!



input time = 930;

input price=open;

rec time_value = if(secondstilltime(time)== 0,price,time_value[1]);

plot open = if(time_value==0, double.nan,time_value);

1 comment:

Dan Beaulieu said...

better way:
def dailyOpen = open(period = AggregationPeriod.DAY);