Skip to content

Instantly share code, notes, and snippets.

View marketcalls's full-sized avatar

Marketcalls marketcalls

View GitHub Profile
@marketcalls
marketcalls / Backtesting Settings.afl
Created January 22, 2015 04:23
Backtesting Settings
SetTradeDelays( 1, 1, 1, 1 ); //set trade delays at 1 bar open
RoundLotSize = 50; // Define Round Lot Size of the Trading Instrument
SetPositionSize ( 100,spsShares); // Define Fixed Trading Size
SetOption( "InitialEquity", 200000 );
SetOption( "MinShares", 1 );
SetOption( "MinPosValue", 1 ); // Enable Futures Mode
SetOption( "FuturesMode", True );
SetOption( "AllowPositionShrinking", True );
SetOption( "ActivateStopsImmediately", False );
SetOption( "ReverseSignalForcesExit", False );
@marketcalls
marketcalls / Portfolio Backtesting.afl
Created January 22, 2015 06:06
portfolio backtesting
SetTradeDelays(1,1,1,1);
SetOption( "InitialEquity", 400000 );
SetOption( "MinShares", 1 );
SetOption( "MinPosValue", 1 ); // Enable Futures Mode
SetOption( "FuturesMode", True );
SetOption( "AllowPositionShrinking", True );
SetOption( "ActivateStopsImmediately", False );
SetOption( "ReverseSignalForcesExit", False );
SetOption( "AllowSameBarExit", False );
@marketcalls
marketcalls / Autocorrelation - Pinescript
Created February 3, 2015 18:44
Autocorrelation - Tradingview
//Author - Rajandran R
//www.marketcalls.in
study("Autocorrelation - Marketcalls")
len=input(10, minval=1,maxval = 50)
Dayreturn=roc(close,1)
autocorr = correlation(Dayreturn,Dayreturn[1],len)
plot(autocorr, color = green , style = line , linewidth = 2,title = "Autocorrelation")
hline(0, title='hline1', color=red, linestyle=dotted, linewidth=2)
@marketcalls
marketcalls / Autocorrelation - Amibroker
Created February 3, 2015 19:54
Autocorrelation - Amibroker
_SECTION_BEGIN("Auto correlation");
Dayreturn=ROC(C,1);
AC = Optimize("AC",10,1,50,1);
AutoCor=Correlation(Dayreturn,Ref(Dayreturn,-1),AC);
Plot(AutoCor,"AutoCorrelation",colorRed);
Plot(0,"",colorGreen,style = styleDots);
_SECTION_END();
@marketcalls
marketcalls / Autorcorrrelation and Stochastic Mean Reversion Trading
Last active July 14, 2024 17:02
Autorcorrrelation and Stochastic Mean Reversion Trading
//code by Rajandran R
//Author - www.marketcalls.in
_SECTION_BEGIN("Stochastic Mean Reversion Trading");
SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0, 0)));
@marketcalls
marketcalls / gist:2ff7113b5297447b1f7d
Created February 13, 2015 04:42
Supertrend V3.0 Without Popup
/* Done by Rajandran R */
/* Author of www.marketcalls.in */
/* Date : 10th Dec 2014 */
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
@marketcalls
marketcalls / High Beta Scanner.afl
Created February 21, 2015 03:03
High Beta Scanner
_SECTION_BEGIN("High Beta Scanner");
ticker=ParamStr( "Ticker", "NIFTY-I" );
P=Foreign(ticker,"C",1);
Periods=Param("period",21,1,50,1);
Beta=(( Periods * Sum(ROC( C,1) * ROC(P,1),Periods )) - (Sum(ROC(C,1),Periods) *
Sum(ROC( P,1),Periods))) / ((Periods * Sum((ROC(P,1)^2 ),Periods)) -
(Sum(ROC(P,1 ),Periods)^2 ));
@marketcalls
marketcalls / Kiss and Touch.afl
Created March 16, 2015 14:48
Kiss & Touch With The Modified True Range
//Coded by Rajandran R
//Author : www.marketcalls.in
//Date : 16th March 2015
//Reference : http://traders.com/Documentation/FEEDbk_docs/2015/04/TradersTips.html#item4
_SECTION_BEGIN("Kiss and Touch");
Goal = Param("Goal", 10 , 10,1000,1);
@marketcalls
marketcalls / VIX-WVF Per Rank.afl
Last active September 17, 2021 10:27
VIX-WVF Per Rank
//Coded by Rajandran R
//Website : www.marketcalls.in
//Date : 16 Mar 2015
_SECTION_BEGIN("VIX-WVF Per Rank");
SetPositionSize(100,spsshares);
VIX = Foreign( "INDIAVIX", "C" );
@marketcalls
marketcalls / Normalized Volume.afl
Created March 19, 2015 22:34
Normalized Volume
//Coded by Rajandran R
//Website : www.marketcalls.in
//Study Reference : http://www.bollingerbands.com/bbandsforum/viewtopic.php?p=478&sid=33ab6920a3eb9788fd5e4b891e189e04
_SECTION_BEGIN("Normalized Volume");
nVolume = V/MA(V,50) * 100;
Plot( nVolume, _DEFAULT_NAME(), IIf( nVolume >= 150, ParamColor("High Volume", colorGreen ), IIf(nVolume <= 75 , ParamColor("Low Volume", colorRed ),ParamColor("Normal Volume", colorYellow )) ), ParamStyle( "Style", styleHistogram | styleThick, maskHistogram ) );
_SECTION_END();