Plot individual horizontal lines of support


Category:
0
0

Hi Pete!

You previously helped me to write some code to track the intraday high until a moving average crosses VWAP.

I would like to plot individual horizontal lines of support whenever there is a breakout candle that closes above the previous high to indicate the support line at the breakout level.

How does one create horizontal lines whenever a condition is found in the code below that close > trackHigh[1]? I will include the code in the first reply as it’s giving me a max character error.

Thanks!

Marked as spam
Posted by (Questions: 3, Answers: 11)
Asked on June 19, 2020 5:18 pm
164 views
0
Code is as follows: input marketOpen = 930; input marketClose = 1600; plot currentVWAP = reference VWAP; def openCounter = SecondsFromTime(marketOpen); def closeCounter = SecondsTillTime(marketClose); def marketHours = if openCounter >= 0 and closeCounter >= 0 then 1 else 0; plot maOne = MovAvgExponential(close, 15, 0, no); rec dailyHigh = if (marketHours and maOne < currentVWAP) then if high > dailyHigh[1] then high else dailyHigh[1] else dailyHigh[1]; def beforeExpCross = if (marketHours) then dailyHigh[-1] else Double.NaN; def newDay = GetDay() GetDay()[1]; def crossAbove = maOne[1] < currentVWAP[1] and maOne > currentVWAP; rec trackHigh = if newDay then beforeExpCross else if crossAbove then Double.NaN else if beforeExpCross > trackHigh[1] then beforeExpCross else trackHigh[1]; plot highBeforeCross = trackHigh;
( at June 19, 2020 5:18 pm)
0
Private answer

The character limit is their to remind folks that any code longer than 24 lines needs to be saved to a plain text file and included as a file attachment when you submit your question.

You cannot achieve what you have described in your post using Thinkorswim. This would require a platform that allows custom chart studies to create and modify drawing tools. The only thing you get to work with on Thinkorswim are plots and plots are not able to achieve what you have requested.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on June 19, 2020 5:36 pm