Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 7/23/2006 Posts: 9
|
'*************************************'* Test: PlotColor = Color.Green if over MA and Color.Red if under MA *'*************************************'# MA = indicator.MovingAverage.3If price.close > Ma.Value(0) Then PlotColor=Color.GreenElseIf price.Close > Ma.Value(0) Then PlotColor=Color.RedEnd IfThis paintbrush code has no errors but when i apply it, the default price graph disappears... any ideas?
|
|
Registered User Joined: 7/23/2006 Posts: 9
|
This works a bit better:)
'*************************************
'* Test: PlotColor = Color.Green if over MA and Color.Red if under MA *
'*************************************
'# MA = indicator.MovingAverage.3
If price.close > Ma.Value(3) Then
PlotColor=Color.LimeGreen
ElseIf price.Close < Ma.Value(3) Then
PlotColor=Color.Red
End If
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You probably figured out that a color was not getting assigned when Price was less than or equal to the the Moving Average (of three bars ago). While it probably won't be too common (this depends on the Moving Average settings to some extent), you are still not assigning a color when Price equals the Moving Average. You may want to try resolving the issue by replacing the following line:
ElseIf price.Close < Ma.Value(3) Then
With the shorter line:
Else
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |