Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 5/13/2007 Posts: 48
|
I'm playing around with some homemade indicators and one of them won't display when I save it. The math is sound but it doesn't show up on my chart for some reason. It is "plot = (price.High - price.Low) / (price.Close - price.Open)". Is there a reason why this formlua won't display?
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
Let me add this to my previous post... the scaling on the right side of the indictaor window also does not display, however the indicator's last value does show up where the scaling should be. The indicators value also shows up correctly when using the crosshair pointer, but again the indicator itself does not show up in its respective window on the chart. It acts as if the "show" button isn't checked in the indicator edit menu even though it is checked.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You are probably getting a Division by Zero error when Price.Close = Price.Open. You might want to try something like the following instead:
If Price.Last <> Price.Open Then
Plot = (Price.High - Price.Low) / (Price.Last - Price.Open)
Else
Plot = Single.NaN
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
That's what it was, divide by zero error on days when open and close prices were the same. I pasted in your solution and now it displays. Thanks Bruce. Steve
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |