## New version 18 available now

Subscription & data-feed pricing Class schedule

Margin rates Stock & option commissions

 Positive Close Rate this Topic:
 Previous Topic · Next Topic Watch this topic · Print this topic ·
toychin
 Posted : Monday, November 13, 2017 7:38:36 PM
Gold Customer

Joined: 12/10/2011
Posts: 11

Could you create a PCF to scan for stocks that compares the positive closes with the same exact matching closing price for the previous 12 bars for monthly closes and 30 bars for weekly closes.

Bruce_L
 Posted : Tuesday, November 14, 2017 9:56:01 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,316

I am really not quite sure what you are asking. The following assumes a positive close means the close is greater than the previous close. It checks for the current close to be positive, and then counts the number of matching closes starting 2 bars back (since 1 bar back can't match since by definition it is lower).

So for a 12 bar count:

`(C > C1) * ((C = C2) + (C = C3) + (C = C4) + (C = C5) + (C = C6) + (C = C7) + (C = C8) + (C = C9) + (C = C10) + (C = C11) + (C = C12) + (C = C13))`

And a 30 bar count:

`(C > C1) * ((C = C2) + (C = C3) + (C = C4) + (C = C5) + (C = C6) + (C = C7) + (C = C8) + (C = C9) + (C = C10) + (C = C11) + (C = C12) + (C = C13) + (C = C14) + (C = C15) + (C = C16) + (C = C17) + (C = C18) + (C = C19) + (C = C20) + (C = C21) + (C = C22) + (C = C23) + (C = C24) + (C = C25) + (C = C26) + (C = C27) + (C = C28) + (C = C29) + (C = C30) + (C = C31))`

Additional clarification would be required if you mean something else.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
 Posted : Tuesday, November 14, 2017 2:18:12 PM
Gold Customer

Joined: 12/10/2011
Posts: 11

A positive close is the candle closes positive for the period.

The first scan should identify only the positive monthly closes going back twelve candle bars with that of only the positive closes of the previous 30 weekly candle bars. Compare only the positive closes and when any matching monthly and weekly closes should produce a list of stocks.

Bruce_L
 Posted : Tuesday, November 14, 2017 2:34:23 PM

Worden Trainer

Joined: 10/7/2004
Posts: 64,316

I am sure I am just not reading it right, but the explanation really didn't expand on the original request in a way which provided me with any additional clarification as to what you want. I still don't understand the request.

What is a positive close "for the period"? Is the close above some other previous close during the period? Is the close above the open? Something else?

You only want to compare positive closes? Not all closes?

You want to return true if any of the positive closes in either the most recent 12 months or 30 weeks matches the value of any other positive close?

Note that if you want to compare the closes of calendar weeks to the closes of calendar months, this cannot be done.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
 Posted : Tuesday, November 14, 2017 6:03:00 PM
Gold Customer

Joined: 12/10/2011
Posts: 11

Yes, the positive candle is when the close is above the open, green candle.

If you can figure out another way to compare matching monthly and weekly closes, please let me know, otherwise it will be a manual process.

Bruce_L
 Posted : Wednesday, November 15, 2017 9:33:14 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,316

We can create a monthly indicator formula for the number of matching pairs of monthly positive closes during the most recent 12 months.

`CountTrue(O < C AND C = C1 AND C1 > O1, 11) + CountTrue(O < C AND C = C2 AND C2 > O2, 10) + CountTrue(O < C AND C = C3 AND C3 > O3, 9) + CountTrue(O < C AND C = C4 AND C4 > O4, 8) + CountTrue(O < C AND C = C5 AND C5 > O5, 7) + CountTrue(O < C AND C = C6 AND C6 > O6, 6) + CountTrue(O < C AND C = C7 AND C7 > O7, 5) + CountTrue(O < C AND C = C8 AND C8 > O8, 4) + CountTrue(O < C AND C = C9 AND C9 > O9, 3) + CountTrue(O < C AND C = C10 AND C10 > O10, 2) + CountTrue(O < C AND C = C11 AND C11 > O11, 1)`

And we can create a weekly indicator formula for the number of matching pairs of weekly positive closes during the most recent 30 weeks.

`CountTrue(O < C AND C = C1 AND C1 > O1, 29) + CountTrue(O < C AND C = C2 AND C2 > O2, 28) + CountTrue(O < C AND C = C3 AND C3 > O3, 27) + CountTrue(O < C AND C = C4 AND C4 > O4, 26) + CountTrue(O < C AND C = C5 AND C5 > O5, 25) + CountTrue(O < C AND C = C6 AND C6 > O6, 24) + CountTrue(O < C AND C = C7 AND C7 > O7, 23) + CountTrue(O < C AND C = C8 AND C8 > O8, 22) + CountTrue(O < C AND C = C9 AND C9 > O9, 21) + CountTrue(O < C AND C = C10 AND C10 > O10, 20) + CountTrue(O < C AND C = C11 AND C11 > O11, 19) + CountTrue(O < C AND C = C12 AND C12 > O12, 18) + CountTrue(O < C AND C = C13 AND C13 > O13, 17) + CountTrue(O < C AND C = C14 AND C14 > O14, 16) + CountTrue(O < C AND C = C15 AND C15 > O15, 15) + CountTrue(O < C AND C = C16 AND C16 > O16, 14) + CountTrue(O < C AND C = C17 AND C17 > O17, 13) + CountTrue(O < C AND C = C18 AND C18 > O18, 12) + CountTrue(O < C AND C = C19 AND C19 > O19, 11) + CountTrue(O < C AND C = C20 AND C20 > O20, 10) + CountTrue(O < C AND C = C21 AND C21 > O21, 9) + CountTrue(O < C AND C = C22 AND C22 > O22, 8) + CountTrue(O < C AND C = C23 AND C23 > O23, 7) + CountTrue(O < C AND C = C24 AND C24 > O24, 6) + CountTrue(O < C AND C = C25 AND C25 > O25, 5) + CountTrue(O < C AND C = C26 AND C26 > O26, 4) + CountTrue(O < C AND C = C27 AND C27 > O27, 3) + CountTrue(O < C AND C = C28 AND C28 > O28, 2) + CountTrue(O < C AND C = C29 AND C29 > O29, 1)`

You can add > 0 to the end of each of the formulas to turn them into condition formulas which just test for at least one pair of matching positive closes during the span. There isn't a way to compare the monthly and weekly positive closes to each other however and count those as well.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
toychin
 Posted : Wednesday, November 15, 2017 8:48:45 PM
Gold Customer

Joined: 12/10/2011
Posts: 11

Thanks Bruce.

I was able to follow your formula to make it a condition and extended the monthly from 12 to 15 bars.

Bruce_L
 Posted : Thursday, November 16, 2017 8:54:44 AM

Worden Trainer

Joined: 10/7/2004
Posts: 64,316

You're welcome. I am happy to read you were able to modify the formula on your own.

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