Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

First Bullish candle after a high Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
j_f_mcgovern
Posted : Tuesday, April 1, 2014 8:13:17 PM
Registered User
Joined: 1/31/2013
Posts: 8

Hi,

I'm trying to write a formula to show the first candle, where close is higher than open, within 5 candles after a new high of the past 250 candles.

So I thought this (but it doesn't work). Can you help, please?

(C1 = MaxC250 AND C > O)

 
OR
 
((C2 = MaxC250 AND (C1 > O1 OR C > O))
 
OR
 
((C3 = MaxC250) AND (C2 > O2 OR C1 > O1 OR C > O))
 
OR
 
((C4 = MaxC250) AND (C3 > O3 OR C2 > O2 OR C1 > O1 OR C > O))
 
OR
 
((C5 = MaxC250) AND (C4 > O4 OR C3 > O3 OR C2 > O2 OR C1 > O1 OR C > O))
 
 

 

Bruce_L
Posted : Wednesday, April 2, 2014 10:04:19 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

There isn't anything wrong with your formula if you are comparing the five previous closes to the current most recent 250 closes to define your new high and want any bar after that new high having a close above the open qualify condition formula to return true now. These would be perfectly valid choices, but if the formula doesn't match your expectations, then these choices probably actually aren't what you want.

But the formula would depend on both the definition of a new high and if you want the current bar to be the first bar where the close is higher than the open the new high or not. For example, the following defines a new high as the high of the bar being higher than any of the previous 249 highs and only returns true when the current bar is the first bar after the new high with a close above the open.

C > O AND (H1 > MAXH249.2 OR (C1 <= O1 AND H2 > MAXH249.3) OR (C1 <= O1 AND C2 <= O2 AND H3 > MAXH249.4) OR (C1 <= O1 AND C2 <= O2 AND C3 <= O3 AND H4 > MAXH249.5) OR (C1 <= O1 AND C2 <= O2 AND C3 <= O3 AND C4 <= O4 AND H5 > MAXH249.6))

But this may or may not be what you want either. If it isn't what you want, we would need further clarification from you as to your particular definitions or intent for the formula.



-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.