Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

this paintbrush makes the default price chart disappear completely Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Reno
Posted : Wednesday, April 23, 2008 10:37:46 PM
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?
Reno
Posted : Wednesday, April 23, 2008 10:55:59 PM
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
Bruce_L
Posted : Thursday, April 24, 2008 8:15:12 AM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.