Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Historical Correlation Amibroker AFL code

1 min read

We recently decided to see how correlated the S&P Nifty is with Dow Jones (US index) and if they were becoming more or less correlated in recent years. The below chart shows the 20 day correlation between S&P Nifty Index and Dow Jones Index. From the charts one can see that during Mid of May the correlation achieves its peak value(0.93) and from there correlation starts dropping which indicates that S&P Nifty will decouple slowly from Dow Jones Market movements in the upcoming days.

Investopedia Says,

“Correlation is computed into what is known as the correlation coefficient, which ranges between -1 and +1. Perfect positive correlation (a correlation co-efficient of +1) implies that as one security moves, either up or down, the other security will move in lockstep, in the same direction. Alternatively, perfect negative correlation means that if one security moves in either direction the security that is perfectly negatively correlated will move in the opposite direction. If the correlation is 0, the movements of the securities are said to have no correlation; they are completely random.”

[wp_ad_camp_5]

 

Historical Correlation between Nifty and Dow Jones


Nifty Correlation

How to Apply Historical Correlation AFL code in Amibroker

1.Download Historical Correlaion AFL code
2.Unzip and Copy the file to c:program filesamibrokerformulasindicators folder
3.Open Amibroker and Open a New Blank Chart
4.goto Charts->Basic Charts->Price indicator. Now Drag and Drop to the Blank Chart
5.goto Charts->Indicators->Historical Correlation. Double Click on the indicator
6.Right Click over the Historical Correlation Panel and Enter the symbol name which needs to be checked for correlation with main symbol on the charts
7.Press OK to see the Historical Correlation plotted below the price chart

properties

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Stoploss, Multi Target, and Trailing Stoploss Module – Amibroker…

After Intraday V2.0 Amibroker Module - a readymade drag and drop module to convert any trading strategy into the intraday trading system with alerts,...
Rajandran R
6 min read

Line Trading – Algomojo Automation Module for Amibroker Users

The line Trading Automation tool is designed for Manual traders who want to perform level-based trade execution faster and also bring some advanced trade...
Rajandran R
58 sec read

Plotting Day Wise Equity Curve using Amibroker

We know that Amibroker provides an equity curve for the whole strategy. Is there a way where we can build a simple Day Wise...
Rajandran R
1 min read

6 Replies to “Historical Correlation Amibroker AFL code”

    1. @Kalyan

      Make Sure you had done with all the above mentioned procedure. Do you added the correlation symbol in the parameters section as mentioned above?

  1. Dear rajandran sir,
    can u tell what afl or stratergy u yourself use to trade
    preyank

  2. Thank you very much i was looking for this.
    Is it possible to have a drop down list instead of having to type in each symbol?

  3. Thanks very much for sharing. I have used and adapted several pieces of your code for my own use. Your code is very understandable! I realize it takes time and effort to share!!!! Dave.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More