Registered User Joined: 4/13/2014 Posts: 11
|
Bruce,
I am trying to create a condition that passes when the price increases based on two other conditions that are not price relevant.
See Image: The White arrow reflects my OUT condition and the Pink arrow reflects my IN condition based on my AVG UP/DOWN Days %21 chart.
The problem is I need to base my realcode to first locate the OUT condition and then look to find the previous IN condition so that I can pull the price difference between the two points.
In the image example, itf I wrote the code right, the IN price would be 13.81 (date 4/29/14) and the OUT price would be 14.7 (date 6/3/14).
Here is my current code:::
'# IN = chartCondition.INTOSLUMP
'# OUT = chartCondition.UPOUTOFSLUMP
Static PriceOut As Single = 0
Static PPCD As Single = 0
If OUT.value Then
PriceOut = price.Close
End If
If IN.value Then
PriceIn = price.close
End If
If PriceOut > PriceIn Then pass
================
Any help would be much appreciated!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I tried to keep the alterations to your RealCode to a minimum.
'# ValidName = chartCondition.INTOSLUMP
'# OUT = chartCondition.UPOUTOFSLUMP
Static PriceOut As Single
Static PriceIn As Single
If isFirstBar Then
PriceOut = 0
PriceIn = 0
End If
If OUT.value Then
PriceOut = price.Close
End If
If ValidName.value Then
PriceIn = price.close
End If
If PriceOut > PriceIn Then pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|