 # TOS chart labels

Discussion in 'General Discussion' started by GreenZone, Feb 4, 2016.

1. ### GreenZoneWell-Known Member

When I show my charts during any of the trading group meetings, people notice that my TOS charts have a bunch of labels at the top showing various stats which I like to track.
I've received a whole bunch of emails from people asking me where they can find this within TOS.
These labels are my own custom code. I wasn't planning on releasing this code......but it's easier to release the code than answering all of these email requests So here it is:
http://tos.mx/QlQJq5

To import the above chart, in TOS go to the Setup button on the top right, pull down to "Open shared item..", paste in the URL from above, and press Enter.

Please don't post this code in the public forum threads, even here at CapitalDiscussions. (this thread is in a CD members only section)

Wes Y, dacamon, Andrei and 9 others like this.
2. This is fantastic, thanks!

3. Got it. Thank you. Very nice and useful.

4. Thanks Ron,

I have a question about how you calculate Weekly and Monthly Std Dev:

For weekly, you calculate
def ImpPts2 = close * vol * Sqrt(7/252);

For monthly, you calculate
def ImpPts3 = close * vol * Sqrt(30/252);

Which is different and doesn't seem to be correct. I assume you use 252 since that's approximately how many trading days there are in a year although, I've seen 365 and 365.25 used. But, for weekly, isn't SQRT(1/52) since there are 52 weeks in a year the correct calculation? And for monthly, isn't SQRT(1/12) the correct calculation?

If you have other reasons or justification for using 7/252 and 30/252, I'd love to hear them.

5. ### GreenZoneWell-Known Member

Thanks for bringing that up.
I agree that the calculation can be made more accurate by slightly tweaking the numbers, such that all numbers are reflective of trading days rather than calendar days.
I would suggest the following changes:

For weekly:
def ImpPts2 = close * vol * Sqrt(5/252);

For monthly:
def ImpPts3 = close * vol * Sqrt(21/252);

---

Here's the updated code:
http://tos.mx/vQMb9q

Last edited: Feb 15, 2016
6. If you use, 5/252 (vs. 1/52), then you are saying that there are only 50.4 weeks in a year.

Also, with 24/252 (vs 1/12), you are saying that there are only 10.5 months in a year.

Why not use:
For weekly:
def ImpPts2 = close * vol * Sqrt(1/52);

For monthly:
def ImpPts3 = close * vol * Sqrt(1/12);

7. ### GreenZoneWell-Known Member

The numbers inside the Sqrt function need to be the "number of days" you are interested in for the std dev calculation divided by the "total number of days in a year".
Some people choose to use calendar days for both (eg a week would be 7/365).

I prefer to use trading days, rather than calendar days.
There are 252 trading days in a year.
Therefore in one week there would be 5 trading days, which means you would use Sqrt(5/252)

For the monthly calculation, we know that there are 252 trading days in a year, so if we divide 252 by 12, then this gives us 21.
This means that there are 21 trading days per month, therefore you would use Sqrt(21/252).

You'll notice that your numbers are very close to the above, so it's up to you which of the two you wish to use.

8. I see you edited your above post to change the 24/252 to 21/252. And as you stated, 252/12 = 21, so 21/252 = 1/12.

I agree, the difference between sqrt(5/252) = 0.14086 vs sqrt(1/52) = 0.13867 is probably negligible, but why not use the more accurate of the two?

Implied volatility is defined as the expected % move over the next year. So, I can understand the use of 252 for trading days/year instead of 365 days/year to calculate the 1 day IV (or expected move). But, there are always 52 trading weeks/year, so using 1/52 should be more accurate than 5/252.

9. ### GreenZoneWell-Known Member

Yes sorry, I noticed the typo after the fact.

Both 1/52 and 5/252 are extremely similar to one another, so I think using either is fine.

10. Hi GreenZone ,
I just suscribe to the RTT trade alerts. Today I receive a trade alert to put a gtc order of a vertical spread only when the spx reach a certain price and with a @mark+.15 limit . I don´t know how to put this type of order in tos platform . Can you help me ?

thanks

11. ### GreenZoneWell-Known Member

You should post your question in the RTT member's forum.
I'm not part of the subscription service.

12. ok thanks