♥ 0 |
input startDateYyyyMmDd = 20200805; Hi, is there a way to replace the current Date criteria in this code with:
Marked as spam
|
Private answer
Ok so from the clarifications provided in the comments section above we understand the request is to have the computation begin on the first bar of the chart regardless what number of trading session are displayed on the chart. In order to solve this we don't need to work with any date/time components at all. We simply replace the section that uses the date/time element with a statement that is true from the very first bar all the way through to the last bar on the chart:
However there is a way to cut this down even further by completely removing everything in the code that tries to pick a starting point for the computations:
Also notice I have replaced the plot named VWAP with a new variable named vwapValue. Why? Because vwap is a reserved keyword in the Thinkorswim language: https://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Fundamentals/vwap We need to be aware of these details. In this case it does not cause a problem. However when you take a reserved keyword and assign it as a variable name you change the way that reserved keyword behaves throughout the rest of the code. That will eventually get you in trouble, even though you will see mistakes like this in the code provided by the built-in chart studies that come with Thinkorswim. (the VWAP chart study being one of them) Marked as spam
|
Please log in to post questions.