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 |

Correlating two indicators Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jbgoodell
Posted : Friday, March 11, 2011 12:28:41 PM
Registered User
Joined: 3/22/2005
Posts: 1
I wish to correlate the current stochastic with the current stock price and the stock price delayed or advanced (Mathematically, this is called the Covariance). This, of course must be done on a running basis.Mathematically it would involve multiplying the difference between the current stochastic value and its average over some period, say 10 or 20 periods, by the difference between the current price and its average over the same period.This product is then averaged over the same period.The process can be made much simpler by simply multiplying the current stochastic by the current or delayed/advanced price and summing the product over a selected number of periods. Dividing the product by the number of periods is really not necessary since it only adds a constant factor.So, it would be satisfactory to average the product of the current stochastic by the stock price over some number of periods. The stochastic I am looking at now is 12 %K3 imposed over D5.
Bruce_L
Posted : Friday, March 11, 2011 1:02:20 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Is there a particular reason you want covariance instead of correlation? The reason I ask is that there is a Correlation Block which makes the correlation calculations trivial to implement.

You should be able to Open an attached Indicator directly into a running copy of StockFinder 5 (and save it from within StockFinder 5 if desired). You could also Save it to the \My Documents\StockFinder5\(Your Username)\My Indicators\ folder and then load it like you would any other Indicator (or Copy and Paste it there from wherever it Saves if you can't specify the destination directory when Saving).

Attachments:
Stoch Correlation to Price.sfInd - 6 KB, downloaded 750 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jas0501
Posted : Saturday, March 12, 2011 2:03:04 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
If you use the correlation block, be aware that it, as far as I know, still contains a bug where the correlation values exceed the range to -1 to +1. That is values like -6.3 or + 7.2 occur. 

It does provide useful measure even with the occasional bad value. Then constructing a market index of the correlation plot provides correlation accross symbols.

feltburner
Posted : Friday, June 6, 2014 11:48:44 AM
Registered User
Joined: 1/16/2005
Posts: 72

How would I use this Correlation Block with an indicator other than the stochastic for which it was written?  I have a custom indicator and wish to determine its correlation with price.  I tried writing my own covariance and correlation formulas in RealCode but must have something wrong, as when I checked by running the correlation of price with its 1 period moving average the results were all over the board when theoretically they should be a constant 1.0 value.  Given those results, I think I'd be better off just using the correlation block if possible.

Bruce_L
Posted : Friday, June 6, 2014 2:50:55 PM


Worden Trainer

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

Block Diagrams have been de-emphasized in StockFinder but the Your First 3 Block Diagrams video covers creating Block Diagrams.

Start by adding your custom indicator and the Stoch Correlation to Price indicator to the same chart.

What you need to do is edit the Block Diagram for the Stoch Correlation to Price indicator. Then left click and drag on Input1 of the Correlation Block. This is where the output of the Moving Average Block fed by the Stochastic Block is going into the Correlation Block.

You will choose Link From Another Tool from the context sensitive menu which appears and then choose your custom indicator from the list.

You can then delete the Stochastics and Moving Average Blocks along with their periods from the Block Diagram since they are no longer feeding any other Blocks.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
feltburner
Posted : Monday, June 9, 2014 11:49:58 AM
Registered User
Joined: 1/16/2005
Posts: 72

Worked great, thanks yet again Bruce.

- Bruce V.

Bruce_L
Posted : Monday, June 9, 2014 12:15:20 PM


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.