Show Study base on day of the week


Category:
0
0

Hi Pete,
i have 5 TOS studies for intraday Support Resistance lines (manual input numbers). each day of the week (Mon-Fri) has different lines (thus 5 studies)
is there a way to simply add a line on top of each study something similar like hide_on_Friday (instead of hide_on_intraday )

so that the Support Resistance lines for monday are not plotted on other days, when i need to view one week chart

or you might have some other brilliant idea ?

thanks so much 

Marked as spam
Posted by (Questions: 2, Answers: 4)
Asked on July 31, 2020 11:26 am
321 views
0
Private answer

https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Date---Time/GetDayOfWeek

The link above provides the description as well as an example. The example uses a chart bubble but it can be applied to any plot statement in your chart study. The following example plots a line at 100 only when the day on the chart is Monday.

plot keyLevel = if GetDayOfWeek(GetYYYYMMDD()) == 1 then 100 else Double.NaN;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 31, 2020 3:53 pm