How to allign AddVerticalLine and AddCloud


Category:
0
0

If you peek at the code below, you’ll see that the daily bar and cloud align perfectly, but the vertical line is offset, slightly, even though they are the same date. Therefore, I’m wondering if adding a time input to the vertical line is possible so that the bar, cloud, and line may be perfectly aligned? Thank you.

input showCloud = yes;

input Day1 = 20200513;
input Day2 = 20200624;
plot retro1 = if GetYYYYMMDD() >= Day1 and GetYYYYMMDD() <= Day2 then double.positive_infinity else double.nan;
AddCloud(showCloud, retro1, color.magenta, color.magenta);

input Date_2020May13 = 20200513;
def Bar_2020May13 = DaysTillDate(Date_2020May13) == 0;
AddVerticalLine(Bar_2020May13, ” Text Goes Here “, Color.Light_Green, Curve.Firm);

Attachments:
Marked as spam
Posted by (Questions: 2, Answers: 0)
Asked on May 21, 2021 10:15 am
120 views
0
Private answer

Sorry but it is not possible to get these two functions to line up. The AddVerticalLine plots ahead of the target bar while the AddCloud begins shading from the center of the bar. Neither of these functions provide for anyway to change this alignment.

Here is the reference for AddVerticalLine:

https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddVerticalLine

And here is the reference for AddCloud:

https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddCloud

 

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 21, 2021 11:09 am