Windicator update links

At any time if you see errors like plugin update required or incompatible bridge version, then use these links to update your copy, they contain newest build.

Current release 20190916

Stable release 20190711

How to install AmiBroker Plugin

  1. Copy librtWindicator.dll file in “C:\Program Files (x86)\AmiBroker\Plugins\
  2. Copy amibroker.conf in “C:\Program Files (x86)\AmiBroker\
  3. For our strategy, use AFL file windicator.afl on charts
  4. For custom strategy, include windicator-1.afl on your AFL.

How to install Order bridge (Robo)

  1. Create a folder in a safe place
  2. Copy libVaca.dll inside that folder
  3. Copy Windicator.exe inside also in same folder.
  4. Set from windows Windicator.exe “run as administrator”
  5. You also need to set your AmiBroker “run as administrator”
  6. Now double-click on Windicator.exe just to ensure it’s working
  7. Make sure any one of the premium strategy ( eg Smart trend follow ) is subscribed in your account at https://apps.randomticks.com/, otherwise robo will not work
  8. Add required columns in nest trader, for details refer setup guide

Make sure Plugin can connect to server

  1. Unless plugin connects to our server,
  2. You won’t see any buy/sell signals
  3. You won’t be able to use bridge functionality
  4. Take a look at status line on top-left side in charts.

Last stable 20190628 (Changed DLL, AFL )

 

Correlation coefficient stock vs NIFTY – 5min table

Correlation coefficient or mathematically speaking auto-correlation tells the strength of positive or negative relationship of the price movement between two instruments, this comparison is valid for Index-component, or stock-commodity for almost everything.

A positively high value of coefficient means stock tends to rise if the index goes up whereas a high negative value means stock loses value if index goes up, in either case, a near zero value means, there is not much relationship exist between the two instruments.

Below is the list of some commonly traded stocks Correlation coefficient;

Relationship wrt NIFTY, timeframe=300s

ASIANPAINT-EQ 0.0906 30/05/2019 19/06/2019
AUROPHARMA-EQ 0.0580 30/05/2019 19/06/2019
AXISBANK-EQ 0.0796 30/05/2019 19/06/2019
BAJFINANCE-EQ 0.3252 30/05/2019 19/06/2019
BANKNIFTY 3.0738 30/05/2019 19/06/2019
BHARTIARTL-EQ 0.0263 30/05/2019 19/06/2019
BIOCON-EQ 0.0199 30/05/2019 19/06/2019
BPCL-EQ 0.0359 30/05/2019 19/06/2019
DABUR-EQ 0.0163 30/05/2019 19/06/2019
DRREDDY-EQ 0.1857 30/05/2019 19/06/2019
GODREJCP-EQ 0.0495 30/05/2019 19/06/2019
GRASIM-EQ 0.0695 30/05/2019 19/06/2019
HCLTECH-EQ 0.0761 30/05/2019 19/06/2019
HDFCBANK-EQ 0.1588 30/05/2019 19/06/2019
HINDUNILVR-EQ 0.1104 30/05/2019 19/06/2019
IBULHSGFIN-EQ 0.1685 30/05/2019 19/06/2019
ICICIBANK-EQ 0.0435 30/05/2019 19/06/2019
INDUSINDBK-EQ 0.2849 30/05/2019 19/06/2019
INFY-EQ 0.0340 30/05/2019 19/06/2019
JETAIRWAYS-EQ 0.0082 30/05/2019 19/06/2019
JUBLFOOD-EQ 0.1052 30/05/2019 19/06/2019
KOTAKBANK-EQ 0.1469 30/05/2019 19/06/2019
LICHSGFIN-EQ 0.0441 30/05/2019 19/06/2019
LT-EQ 0.1035 30/05/2019 19/06/2019
LUPIN-EQ 0.0571 30/05/2019 19/06/2019
M&M-EQ 0.0614 30/05/2019 19/06/2019
NIFTY19JUNFUT 0.8469 17/06/2019 19/06/2019
RELIANCE-EQ 0.1472 30/05/2019 19/06/2019
SBIN-EQ 0.0426 30/05/2019 19/06/2019
SRTRANSFIN-EQ 0.1917 30/05/2019 19/06/2019
SUNPHARMA-EQ 0.0330 30/05/2019 19/06/2019
TATASTEEL-EQ 0.0492 30/05/2019 19/06/2019
TCS-EQ 0.1588 30/05/2019 19/06/2019
TECHM-EQ 0.0388 30/05/2019 19/06/2019
TITAN-EQ 0.0957 30/05/2019 19/06/2019
UPL-EQ 0.0607 30/05/2019 19/06/2019
WIPRO-EQ 0.0072 30/05/2019 19/06/2019
YESBANK-EQ 0.0274 30/05/2019 19/06/2019
ZEEL-EQ 0.0431 30/05/2019 19/06/2019

A sliding window implementation of AR(1) model for financial time series

Below is working c++ equivalent code snippet I am sharing for curious readers, the auto-correlation regression, also known as AR model are popular and classic method for analysis and forecasting time series such as stock prices. AR models comes with many varieties of which AR(1), the single lag is simplest and easier to implement by programming ordinary least square (OLS), understanding this will form basis for developing your own higher order AR models. correlation coefficient obtain using this method can be readily used for Unit root test, to find out whether our time series is stationary.

Without further ado, sharing a sliding window based ( aka moving window ) implementation which are must for all kinds of performance oriented algos, please read code comments, they are there for some explanation.

#include <iostream>
#include <stdio.h>


/****
	Author: randomticks.com
	Subject: AR(1) model examplde code
*/

int main() {

	int n = 10000;// entire price array length
	int pds = 10; // moving window period
	
	///// this is a virtual stock closing price, 
	///// in reality it will be obtained from your charting software
	double* close = new double[n]();
	close[0] = 1000; // starting price
	for(int i=1; i < n; ++i) { 
                if(std::rand()%10 > 5) {
			close[i] = close[i-1] + 1;
		} else {
			close[i] = close[i-1] - 1;
		}

	}

	double* input = new double[n](); // prepare an empty time series input - 0 filled
	double* array = new double[n](); // array to hold predicated values
	
	// below allocating 0 filled arrays in heap 
	double* _sumx = new double[n](); 
	double* _sumy = new double[n]();
	double* _sumx2 = new double[n]();
	double* _sumxy = new double[n]();

	for(int i=1; i < n; ++i ) { // starting the loop from 1 
                input[i] = close[i] - close[i-1];  // this is for 1st order differencing 
                                                                        // one can also use close[i] 
                double y = input[i]; // return 
                double x = input[i-1]; // lag-1 value for return 
                _sumx[i] = _sumx[i-1] + x; 
                _sumy[i] = _sumy[i-1] + y; 
                _sumx2[i] = _sumx2[i-1] + x*x; 
                _sumxy[i] = _sumxy[i-1] + x*y; 
                if( i > pds - 1 ) {
		
			double y_old = input[i-pds];
			double x_old = input[i-pds-1];
	
			_sumx[i] -= x_old;
			_sumy[i] -= y_old;
			_sumx2[i] -= x_old * x_old;
			_sumxy[i] -= x_old * y_old; 
	
			double var = pds*_sumx2[i] - _sumx[i]*_sumx[i];
			double cor = (pds*_sumxy[i] - _sumx[i]*_sumy[i])/var; // correlation coefficient can be 
			double fix = (_sumy[i]*_sumx2[i] - _sumx[i]*_sumxy[i])/var;
			array[i] = fix + cor * input[i-1] + close[i-1];  // predict current closing using lag-1
			
			printf("i=%d	actual= %.2f		forcast= %.2f\n", i, close[i], array[i]);
	
		} 
	}
}

Now comppile it with
g++ -std=c++11 ar1.cpp