mourningwood4521
Member
If you guys can help me with this example instead of me giving you my script and just giving me the fix I need, I want to try to get the fix using the correct answer from the example so I can learn through trial and error. Using this example from thinkscript glossary, this plots a line at the current time frames High and Low.
I want to plot:
input number_of_days_low = 10% above the Lowest Close.
input number_of_days_high = 10% below the Highest Close.
I'm having trouble finding how to do 10%. I see a few different ways to do this on this website but they don't plot the line within 10%. they are plotting the line at 1.0 exactly.I used this post #14 and this post #19 and it doesn't work when I adjusted them to my parameters. Another post had a moving average, and it had --> high (high + low) / 1000; to get the % which didn't make sense.
I'm currently working on a chart that shows the Implied volatility high and low, with Addclouds highlighting the area within say 10% or something closer like 7% from the high/low. Then I will be creating a crossover of the IV into the cloud area to change the line color. which then makes to easy to set for the scan when I can add an other parameter ---> volatility band crossovers, to refine my results.
Code:
def onExpansion = if IsNaN(close) then yes else no;
plot HighestClose = if onExpansion then HighestAll(close) else double.NaN;
plot LowestClose = if onExpansion then LowestAll(close) else double.NaN;
I want to plot:
input number_of_days_low = 10% above the Lowest Close.
input number_of_days_high = 10% below the Highest Close.
I'm having trouble finding how to do 10%. I see a few different ways to do this on this website but they don't plot the line within 10%. they are plotting the line at 1.0 exactly.I used this post #14 and this post #19 and it doesn't work when I adjusted them to my parameters. Another post had a moving average, and it had --> high (high + low) / 1000; to get the % which didn't make sense.
I'm currently working on a chart that shows the Implied volatility high and low, with Addclouds highlighting the area within say 10% or something closer like 7% from the high/low. Then I will be creating a crossover of the IV into the cloud area to change the line color. which then makes to easy to set for the scan when I can add an other parameter ---> volatility band crossovers, to refine my results.
Last edited by a moderator: