Registered User Joined: 12/7/2004 Posts: 2
|
Does anyone have a solution for adding in code to identify "Noise" in the Clear Method as described in the October issue of S&C?
The code for the adding a "noise" filter was not provided in the Trader's Tips section.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You could add Noise to the Paint Scheme as follows:
Static Swing As Integer
Static HighestLow As Single
Static LowestHigh As Single
Dim Noise As Boolean = False
If isFirstBar Then
Swing = 0
HighestLow = Line.Low
LowestHigh = Line.High
End If
If Line.Low > HighestLow Then
HighestLow = Line.Low
Else If Swing = 1 Then
Noise = True
End If
If Line.High < LowestHigh Then
LowestHigh = Line.High
Else If Swing = -1 Then
Noise = True
End If
If Line.Low > LowestHigh Then
Swing = 1
HighestLow = Line.Low
LowestHigh = Line.High
Noise = False
Else If Line.High < HighestLow Then
Swing = -1
HighestLow = Line.Low
LowestHigh = Line.High
Noise = False
End If
If Swing = 1 Then
PlotColor = Color.Lime
Else If Swing = -1 Then
PlotColor = Color.Red
Else
PlotColor = Color.Yellow
End If
If Noise = True Then
PlotColor = Color.White
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 12/7/2004 Posts: 2
|
Perfect! Thanks!
|
Registered User Joined: 10/27/2004 Posts: 821 Location: Philly area
|
Super Job, but I have a question about overlaying various Paint / Label statements is possible without interaction.
Suppose I wanted to label add to the Real Code you wrote to add a label to:
1.) the first Green after the last previous Red Bar
(ignoring the interviening white and yellow Bars)
2/) the first Red after the last previous Green Bar
(again ignoring the white and yellow Bar).
In each case, the label code should not change the Bar colors and need only be something like:
- an arrow of the corresponding color and direction located above or below appropriate first GREEN or RED or bar (againing ignoring all white and yellow bars plus all bars where the RED or GREEN color is not changed)
Could you give an example of how this can be accomplished by a modification to your Real Code, or how it would be done by a second Real Code module if not practical.
Also,
If both methods are possible, is there a likely speed penality of using two Read Code modules instead of just one integrated one?
Thanks Again for yet another super tutorial in real code for us code dummys.
|
Registered User Joined: 10/27/2004 Posts: 821 Location: Philly area
|
OOPS, cancel my request on the previous line - I see you already did for other customers - including a PCF topic too.
I should have looked further when I saw the posting.
Again. Thanks from all of us!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
jschott,
You're welcome. I'm happy to read you were able to find the posts answering your questions.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|