Registered User Joined: 4/13/2014 Posts: 11
|
If I have two indicators saved in my library that I wanted to run correlation and r2 on. How would I go about doing this in realcode?
Thanks,
Greg
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I wouldn't try writing RealCode for this. Start by adding both indicators from the library to the chart.
Then select Add Indicator/Condition to Chart and choose New Indicator from Diagram (it is at the very bottom of the list). You will want the Plot Type set to Numeric.
Left-click and drag on the input to the Numeric Plot Block and choose Select Block & Connect.
Choose the Correlation Block from the list.
Then left-click on drag on Input1 and Input2 to the Correlation Block and choose Link From Another Tool. You will want to select one of your indicators for Input1 and the other one of your indicators for Input2.
You can click on the indicator and select Edit to adjust the period of the Correlation.
You can run the output of the Correlation Block into both inputs of a Multiply Two DLS Block to square the result.
Block Diagrams have been de-emphasized in StockFinder but the Your First 3 Block Diagrams video covers creating Block Diagrams.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 4/13/2014 Posts: 11
|
Thank you Bruce!
|
Registered User Joined: 4/13/2014 Posts: 11
|
The link to the "your first 3 block diagram" doesn't seem to be working.
I am trying to set this up but I am not sure what you mean by Left-click and drag on the input to the Numeric Plot Block and choose Select Block & Connect.
what' the input?
I am hoping the video will help explain.
Thanks,
Greg
|
Platinum Customer
Joined: 3/19/2008 Posts: 64
|
Hey Cortner,
This is how I do it. And it's from memory, so forigve me if incorrect.
1.) Plot both indicators on your chart
2.) Click and drag one indicator on top of the other, and select "create ratio" or "difference". It doesn't matter whch of the options you pick, you just want SF to make some relationship between the two
3.) NOW...click on the new indicator that is created which just plots the difference.
4.) When the edit dialog comes up for that new indicator, in the lower left you will see a blue link that says "show block diagram". Click this link
5.) A window will pop up with a bunch of squares connected by lines. Find the sqaure that says "ratio" or "Difference" it will be named whatever you picked in step #2.
6.) Right-click that square, and select "replace" from the menu.
7.) A new menu pops up with a list.
8.) Find and select "Correlation"
9.) Close the block diagram window, and now on your chart the relationship between indicators will be the correlation
10.) You can now edit this "correlation" to change the period
Good luck!
|