NexusFi: Find Your Edge


Home Menu

 





Thinkscript correction help, please ~ on label for OR Width Average


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,060 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 1 attachments




 
Search this Thread

Thinkscript correction help, please ~ on label for OR Width Average

  #1 (permalink)
teflon
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!

Reply With Quote




Last Updated on November 11, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts