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

Last Thursday Of The Month for Amibroker (AFL)

Rating:
4 / 5 (Votes 1)
Tags:
amibroker, function

USING IF FUNCTION EDITED TO SEE F&O EXPIRY DAY OF THE MONTH, ON PRICE CHART

Screenshots

Similar Indicators / Formulas

Percent Rank
Submitted by genkumag about 13 years ago
Time Left for each bar
Submitted by novicetraders over 14 years ago
Adaptive Laguerre Filter from John Ehlers
Submitted by kaiji almost 15 years ago
Visible Min and Max Value Demo
Submitted by kaiji almost 15 years ago
Chandelier Exit Functions
Submitted by kaiji almost 15 years ago
Averages Functions Include
Submitted by demon about 14 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Expiry Thursday for Indian markets");
//Expiry Thursday for Indian markets

function Lastthursday()
{
 Daysinmonth=IIf(Month()==1 OR Month()==3 OR Month()==5 OR Month()==7 OR
Month()==8 OR Month()==10 OR Month()==12,31,30);
 Daysinmonthfeb=IIf(Year()%4 == 0 AND Year()%100!=0,29,28);
 Daysinmonthfinal=IIf(Month()==2,Daysinmonthfeb,Daysinmonth);
 returnvalue=IIf(Daysinmonthfinal-Day()<7 AND DayOfWeek()==4,1,0);
 return returnvalue;
}
Graph0=Close;
D = DayOfWeek();
Color=IIf(Lastthursday(),ColorRGB(240,200,13),ColorRGB(100,100,50) );
Plot( C, "Close", color,ParamStyle("Style",styleBar |styleThick|styleNoTitle ,maskAll) );
_SECTION_END();

4 comments

1. rani

HI ,
I did nt understand this formula,,plz add me to ur yahoo msg ma80rao

2. alliswell

_SECTION_BEGIN(“Expiry Thursday for Indian markets”);
//Expiry Thursday for Indian markets

function Lastthursday()
{
Daysinmonth=IIf(Month()1 OR Month()3 OR Month()5 OR Month()7 OR
Month()8 OR Month()10 OR Month()==12,31,30);
Daysinmonthfeb=IIf(Year()%4 == 0 AND Year()%100!=0,29,28);
Daysinmonthfinal=IIf(Month()==2,Daysinmonthfeb,Daysinmonth);
returnvalue=IIf(Daysinmonthfinal-Day()<7 AND DayOfWeek()==4,1,0);
return returnvalue;
}
Graph0=Close;
D = DayOfWeek();
FlagExpiry = IIf(Lastthursday(),1,0);
PlotShapes(FlagExpiry * shapeUpTriangle, colorBlack, 0, L);
_SECTION_END();

3. mehtaka

What if the thursday is holiday, would it consider the previous day as exit?

4. vaks

This is not working, pls help

Leave Comment

Please login here to leave a comment.

Back