Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created June 6, 2017 09:09
Show Gist options
  • Save marketcalls/dbd8a23dc8a61448a2c16ff5365cab6c to your computer and use it in GitHub Desktop.
Save marketcalls/dbd8a23dc8a61448a2c16ff5365cab6c to your computer and use it in GitHub Desktop.
Expected Move - Amibroker AFL Code
//Coded by Rajandran R
//Website : www.marketcalls.in
//Date : 5th June 2017
_SECTION_BEGIN("Expected Move");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N( Symbol1= ParamStr("ATM Straddle CE", "NIFTY17JUN9650CE.NFO") );
_N( Symbol2= ParamStr("ATM Straddle PE", "NIFTY17JUN9650PE.NFO") );
pt =ParamToggle("Plot Type", "Percentage| Range",0);
SetForeign( Symbol1 );
C1 = C;
H1 = H;
L1 = L;
O1 = O;
V1 = V;
I1 = OI;
RestorePriceArrays();
SetForeign( Symbol2 );
C2 = C;
H2 = H;
L2 = L;
O2 = O;
V2 = V;
I2 = OI;
RestorePriceArrays();
ExpMove = (c1+c2)*.85;
EMPer = ((c1+c2)*85)/C;
if(pt)
{
Plot(ExpMove,"Expected Move - Range",colorGreen);
}
else
{
Plot(EMPer,"Expected Move - Percentage",colorGreen);
}
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment