Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Formula for Finding Good Condition For Buying SPY (S&P500) Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
akololli
Posted : Friday, July 20, 2012 1:06:37 AM
Registered User
Joined: 5/4/2007
Posts: 17

Dear TC 2000 Trainer,

I am looking for a formula or a scan that can find me the following condition about SPY (SP500 index):

I would like to know (notified by email or by interactive scan of TC2000) If the 5 day (consecutive days) change of SPY is greater than 2.91% (uptrend pattern)

or

I would like to know (notified by email or by interactive scan of TC2000) If the 5 day (consecutive days) change of SPY is lower than 3.27% (downtrend pattern)

At the close of the market (4pm ET) each day, I would like to calculate the change of the S&P 500 over the last 5 trading sessions.

Here's what I think the formula should look like:

(Closing Price Today of the S&P 500 Index (SPY) - Opening S&P 500
Index (SPY) Price 5 Days Ago) / Opening S&P 500 Index (SPY) Price 5
Days Ago

Example of an uptrend:
Closing Price Today = 124.95
Opening Price 5 Days Ago = 121.34
5 Day Change = (124.95 - 121.34) / 121.34 = 2.97%

Example of a downtrend:
Same type of calculation except that the result is -3.27 or lower.

 

If the above condition is TRUE, then I would like to know.

How do I do this?  I know what I would like to do, but don't know exactly what I need to do in TC2000 to help me accomplish this.  I'd like to do this for other indexes, but I would like to start with SPY for now.

 

Thank you for your help,

Abraham

 

Bruce_L
Posted : Friday, July 20, 2012 7:59:53 AM


Worden Trainer

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

You can create an Indicator Formula which will return the Price Percent Change since the open of 5-bars ago as:

100 * (C / O5 - 1)

You could create this as a Custom PCF Indicator, set the Active Symbol to SP-500 on a Daily chart, click on the Custom PCF Indicator and select Set Alert to create an Alert for the SP-500 symbol having this value Greater Than 2.97 or Less Than -3.27.

It should probably be noted that the 5-Period Price Percent Change would normally be calculated from the close of 5-bars ago:

100 * (C / C5 - 1)

A Condition Formula for the Price Percent Change since the open of 5-bars ago being at least 2.97% could be written as:

C >= 1.0297 * O5

A Condition Formula for the value of the Price Percent Change since the open of 5-bars ago being less than -3.27% could be written as:

C <= .9673 * O5

You can plot these Condition Formulas on the chart by using one as a Boolean Formula in a Custom PCF % True Indicator. You can also select Conditions and select Create New Condition Formula to create a Condition Formula and then use it a WatchList Column, Sort or EasyScan Condition.

Personal Criteria Formula Conditions
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
akololli
Posted : Friday, July 20, 2012 8:45:50 AM
Registered User
Joined: 5/4/2007
Posts: 17

Thanks Bruce.  A few questions:

"You could create this as a Custom PCF Indicator, set the Active Symbol to SP-500 on a Daily chart, click on the Custom PCF Indicator and select Set Alert to create an Alert for the SP-500 symbol having this value Greater Than 2.97 or Less Than -3.27."

HOw do you do the above?  I tried to set alert, but the alert only uses price.

Wouldn't these two formulas be close as oppose to open of the market 5 days ago? or is that not the case?  Would it still alert if it was close as opoose to open in the following two formulas you suggested?

C <= .9673 * O5

C >= 1.0297 * O5

Bruce_L
Posted : Friday, July 20, 2012 8:58:45 AM


Worden Trainer

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

QUOTE (akololli)
"You could create this as a Custom PCF Indicator, set the Active Symbol to SP-500 on a Daily chart, click on the Custom PCF Indicator and select Set Alert to create an Alert for the SP-500 symbol having this value Greater Than 2.97 or Less Than -3.27."

How do you do the above?  I tried to set alert, but the alert only uses price.

Did you click on the Custom PCF Indicator and select Set Alert as instructed? If so, the Alert is based on the Custom PCF Indicator and not directly on Price.

Note that you would need to create two Alerts, one for for the Custom PCF Indicator being Greater Than 2.97 and another Alert for the Custom PCF Indicator being Less Than -3.27.

QUOTE (akololli)
Wouldn't these two formulas be close as oppose to open of the market 5 days ago? or is that not the case?  Would it still alert if it was close as opoose to open in the following two formulas you suggested?

C <= .9673 * O5

C >= 1.0297 * O5

These Condition Formulas are for the current Price (or Close of the current bar) versus the Open of 5-bars ago as requested.

"Here's what I think the formula should look like:

(Closing Price Today of the S&P 500 Index (SPY) - Opening S&P 500
Index (SPY) Price 5 Days Ago) / Opening S&P 500 Index (SPY) Price 5
Days Ago"



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
akololli
Posted : Friday, July 20, 2012 7:50:14 PM
Registered User
Joined: 5/4/2007
Posts: 17

Bruce, what type of support does Worden offers if I was to call and see if someone can help me set this up at support center?  I think we're close to nailing this down.

 

Thanks,

 

Abraham

 

Bruce_L
Posted : Monday, July 23, 2012 9:53:59 AM


Worden Trainer

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

Technical support can take you step-by-step through the process of entering formulas on your computer if you already have the formulas you need. They can't help you develop a formula or refine an existing formula however.

So if you can't get the formula entered or to work, then technical support can help you. If the formula is just not finding what you want however, you would need to provide some additional clarification as to your intent in the forums so we could figure out how it needs to be changed.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
akololli
Posted : Wednesday, July 25, 2012 1:37:15 AM
Registered User
Joined: 5/4/2007
Posts: 17

I talked to s aupport person on Saturday, but not sure if he had a bad day or what, but he was no help, even though I had all the formula and everything needed.  I even asked if there's a way for him to control my desktop screen so he can see what is on my screen, but he just wasn't in the mood of helping.  Oh well.  May be another day, another support person.  I'm going to try again on Saturday.

 

Abraham

 

Bruce_L
Posted : Wednesday, July 25, 2012 8:45:28 AM


Worden Trainer

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

Technical support should be contacting you soon.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
akololli
Posted : Saturday, August 4, 2012 5:49:04 PM
Registered User
Joined: 5/4/2007
Posts: 17

Bruce,

 

I talked to Support and they were able to help me.  Thank you for following up.  NOw, I realized that I also missed another aspect of this formula that I didn't communicate with you.  I would like the previous 5 bars (periods) to be all greater than zero (for the strategy that looks for change > 2.97%.

 

In other words, I would like for the previous 5 bars to be green.  Conversly, for the strategy that I would like to find stocks that their previous 5 bars have been < -3.27%, I would like all previous 5 bars to be negative (red candle sticks). 

 

The formula that you gave me, gives me the right stocks, but I would like to filter down those results to only the ones that the previous consecutive 5 bars are either positive or negative.  I realize, I have to have two scans:  One scan for up moving stocks (5 green bars that their price has changed more than 2.97%) .  Second scan that looks for stocks that their price has been moving down (5 consecutive days, 5 red bars, price change > -3.27%).

 

I think we're almost there.  I just need to refine it more.  What do I need to add to the scan you gave me?  What is the formula?

 

Thanks,

 

Abraham

 

Bruce_L
Posted : Monday, August 6, 2012 8:36:16 AM


Worden Trainer

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

If the Color Based on setting for Price History is set to Open vs Close, a Condition Formula for the most recent 5 bars all being green because the Close is greater than the Open would be written as:

C > O AND C1 > O1 AND C2 > O2 AND C3 > O3 AND C4 > O4

And a Condition Formula for the most recent 5 bars all being red could be written as:

C < O AND C1 < O1 AND C2 < O2 AND C3 < O3 AND C4 < O4

If the Color Based on setting for Price History is set to Net Change, a Condition Formula for the most recent 5 bars all being green because the Close is greater than the previous Close would be written as:

C > C1 AND C1 > C2 AND C2 > C3 AND C3 > C4 AND C4 > C5

And a Condition Formula for the most recent 5 bars all being red could be written as:

C < C1 AND C1 < C2 AND C2 < C3 AND C3 < C4 AND C4 < C5

You could then add the desired Condition Formula to the same EasyScan as your existing Condition Formula to check for symbols where both your previous requirement and the new requirement are true.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
akololli
Posted : Friday, August 10, 2012 8:41:45 PM
Registered User
Joined: 5/4/2007
Posts: 17

That was it.  It worked.  Thanks a bunch for all your help.

- Abraham

 

Bruce_L
Posted : Monday, August 13, 2012 8:56:03 AM


Worden Trainer

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

You're welcome.



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