Los Angeles, CA
Posts: 2 since May 2018
Thanks Given: 0
Thanks Received: 0
|
Hello, everyone:
I am new to posting on this forum and very new to ThinkScript. I only wrote my first successful script yesterday.
I am trying to create a simple label to show the average of the opening range (OR) width from the past x number of days.
I am defining the OR width as the OR high minus the OR low. I would like the label to display the average of the OR width from the past x number of days, which is also an input. Here is my script so far, which ToS is not showing as having any errors. However, the label is showing zero.
input length = 23;
input StartTime = 0930;
input EndTime = 1030;
def ORHigh = high between StartTime and EndTime;
def ORLow = low between StartTime and EndTime;
def ORWidth = ORHigh - ORLow;
AddLabel(yes, "ORWidthAverage: " + Average(ORWidth, 23));
I'd be grateful for any assistance you can provide. I can't really give back, since I really don't know much at all about Thinkscript, but I will try in the future.
Thanks in advance!
|