Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Open Interest with Exploration for Amibroker (AFL)

Rating:
5 / 5 (Votes 2)
Tags:
OI, Open Interest, Option Chain, amibroker

Displays open interest data of current month.
It can explore based on OI filters.

Screenshots

Indicator / Formula

Copy & Paste Friendly
//Author :  Ashok Kumar Yadala
//Credits to all authors , code adopted from open source authors and modified as per real time needs!
_SECTION_BEGIN("Total OI");

Symbol1OI_Vege=Foreign(Name(),"I"); 
V1 = Ref(V,-1);C1 = Ref(C,-1);
oi1 = Ref(OI,-1);
vol_up = V>V1;
price_up = C>C1;
oi_up = OI>OI1;
vol_dn = V<V1;
price_dn = C<C1;
oi_dn = OI<OI1;
ROChag = ROC(Symbol1OI_Vege,1);
long_buildup = price_up AND vol_up AND oi_up;
short_buildup = price_dn AND vol_up AND oi_up;
long_unwinding = price_up AND vol_dn AND oi_dn;
short_covering = price_dn AND vol_dn AND oi_dn;
trendSTATUS =
WriteIf(long_buildup,"long_buildup",
WriteIf(short_buildup,"short_buildup",
WriteIf(long_unwinding,"long_unwinding",
WriteIf(short_covering,"short_covering"," "))));
trendCOLOR = IIf(long_buildup, colorGreen,IIf(short_buildup, colorRed,IIf(long_unwinding, 

colorOrange,IIf(short_covering, colorLightBlue, colorWhite))));
Plot(Symbol1OI_Vege ," Current Month OI",trendCOLOR ,styleHistogram);

Title = Name() + " - " + Date() + ", " 
	+" Open=" 	+WriteVal(O,1.0)+ ", "
	+" High=" +WriteVal(H,1.0)+  ", "
	+" Low=" +WriteVal(L,1.0)+ ", "
	+" Close=" +WriteVal(C,1.0) +", "
	+" OI=" +WriteVal(OI,1.0)+", " +" OI% Chg=" +WriteVal(ROChag,1.0);

Long = (price_up AND oi_up AND C1>Ref(C1,-1) AND oi1 >Ref(oi1 ,-1));
Short = ( price_dn AND oi_up AND C1<Ref(C1,-1) AND oi1 <Ref(oi1 ,-1));

Filter = Long OR Short;

AddColumn(C,"Close",1.2);
AddTextColumn(trendSTATUS,"OI Status",1, colorBlack, trendCOLOR,width=110);
AddColumn(C,"Close",1,IIf(C>Ref(C,-1),colorGreen,colorRed));
AddColumn(ROC(C,1),"% Price change",1.2);
AddColumn(Symbol1OI_Vege,"open interest",1,IIf(Symbol1OI_Vege>Ref(Symbol1OI_Vege,-1),colorGreen,colorRed));
AddColumn(ROC(Symbol1OI_Vege,1),"% OI change",1.2);
SetSortColumns( -7,-8);

_SECTION_END();

2 comments

1. S@fewhiteknight1979

Sample

2. dominhy

why do you use Symbol1OI_Vege=Foreign(Name(),“I”) instead of Symbol1OI_Vege=OI ?

Leave Comment

Please login here to leave a comment.

Back