How do I use today's open to calculate an indicator value
Author: jedediah
Creation Date: 2/14/2012 7:01 PM
profile picture

jedediah

#1
I know this has probably been asked and answered somewhere. I have used the search function and the help files and tried numerous code variations and I have gotten nowhere. I am not a programmer, so I hacked the following code together from help files and other indicators:

CODE:
Please log in to see this code.


I bolded the code I need to fix. I would like TLow to plot as a fixed line on the price pane. TLow should be calculated using today's open minus the FailStat.

Any help would be greatly appreciated. Thanks in advance.
profile picture

Cone

#2
In your calculation of TLow, Open is the open of each intraday bar. Assuming that you want to use the Daily Open, you'd have to SetScaleDaily again for that operation. However, when I tried that an error resulted for that DataSeries math operation. Anyway, here a straightforward way to get the result you're looking for:

CODE:
Please log in to see this code.
When plotting TLow, Color.Aquamarine doesn't show up very well if you're using a white background, so you may want to make that color something darker.
profile picture

jedediah

#3
Cone,

Thank you, it works perfectly. I had tried to reset the scale to daily and could not get it to work either...but I don't even live on the same planet as a programmer. Later, when I get a chance to really look at your code, I may have a question or two about it if I can't figure it out...if that's o.k.. Thanks again, big help. Take care.

a.j.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).