RealCode - Pulling the prior condition given another conditions occurance Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
cortner
 Posted : Monday, July 28, 2014 3:25:34 PM
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!

Bruce_L
 Posted : Monday, July 28, 2014 3:51:28 PM

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

 Forum Jump Customer Training & Support - Ask a Trainer - TC2000 version 12/18 - Ask a Trainer - TC2000 version 7 - Ask a Trainer - StockFinder 5.0 - PCFs, EasyScan and Custom Indicators General Discussions - Stock and Market Talk - TC2000 version 12 or 18 - TC2000 version 7 - StockFinder 5.0 - RealCode for StockFinder 5.0 Tutorial Videos - TC2000 version 12 tutorial videos - TC2000 version 7 tutorial videos 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.