RotationDay is a closed day

Hello
My rotation day is the last friday of the month with this afl code

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);
RotationDay=IIf(Daysinmonthfinal-Day()<7 AND DayOfWeek()==5,1,0);

No issue with this code but if the last friday of month is closed, no rotation occurs of course, but I want to do in this case the rotation the previous open day, so the last thursday of this month and if it's a closed day too, so the last wednesday of this month
Any ideas how to code this please ?
Thanks in advance
Best regards

I use this method.

// Auto Dectect ~ use your current code dection method

p_latestBarEndOfPeriod = ParamToggle("Lastest Bar End of Period:", "Auto Dectect|Force End of Period", defaultVal = 0);

if (p_latestBarEndOfPeriod)...

First of all, thanks @TrendSurfer for your reply, it's a good idea but as I'm not anf AFL guru like you, would you please explain me how to determine the latest Bar of End Period for my case, this is not as simple as end of month, for me
Thanks in advance for your help
Best regards

In your current approach, you can replace DayOfWeek()==5 with the result of the TimeFrameExpand function that returns the last trading day of the week. That will then give you the last trading day of the week that falls within the last 7 days of the month.

LastTradingDayOfWeek = TimeFrameExpand(True, inWeekly, expandPoint);
RotationDay = Daysinmonthfinal - Day() < 7 AND LastTradingDayOfWeek;

I wish I was! :smiley:

Some common methods used to detect end of periods work perfectly on historical data but not on current live last bar in database (as you have discovered).

So as in your current situation, you need to let AB know that the current live last bar in the database for that particular bar, is a end of period bar. Otherwise AB won't know that until the next trading day bar is printed.

So when you want to force end of period I do that via ParamToggle(), to be applied to the last current bar only.

Thanks to @TrendSurfer and @MacAllan
I will test that and I will give you a feedback soon

Here the result of my tests

In France, Friday 29th of March 2002 was a closed day, so rotation day should be the 28th of March 2002
Result : OK :slight_smile: in auto-detect and forced mode
ok

But, Thrusday 25th and Friday 26th of December 2003 were closed day, so rotation day should be the Wenesday 24th of December 2003
Result : it doesn't work in auto-detect and forced mode
ko1
ko1f

Third and last example, Friday 25th of March 2005 was a closed day, so rotation day should be the Thursday 24th of March 2005
Result : it doesn't work too :frowning: in auto-detect and forced mode
ko2
ko2f

FIY : I use Amibroker Pro v6.20.1 with EOD database

Others closed days the last Friday of month
25 and 26 Dec 2008 ==> rotationday = Wen 24 Dec 2008
25 Dec 2009 ==> rotationday = Thu 24 Dec 2009
29 Mar 2013 ==> rotationday = Thu 28 Mar 2013
25 and 26 Dec 2014 ==> rotationday = Wen 24 Dec 2014
25 Dec 2015 ==> rotationday = Thu 24 Dec 2015
25 Mar 2016 ==> rotationday = Thu 24 Mar 2016
30 Mar 2018 ==> rotationday = Thu 29 Mar 2018
25 Dec 2020 ==> rotationday = Thu 24 Dec 2020

Thanks for your help
Best regards

Rotation day is not firing because of your method Daysinmonthfinal-Day()<7. 31 (days in December) - 24 (Wednesday 24th December) = 7!

Also please note (as previously mentioned): Forced mode will only affect the very last bar. Once you have more fresh data printed your code will detect that previously forced bar for you (because that previously forced bar will then be a historical bar).

Let us know how you go.

@didrip,

Try this to see if it is working as you need.

/*
Daily periodicity, monthly rotation.
Rotates on the last Friday of every month, if Friday is a non-trading day then previous trading day is the rotation day for that week.

When back testing
	* select 'Trading Mode' to 'Back Testing'
	* if the current month is incomplete (more trading days remaining) select 'Incomplete Month (NOT End of Period)'

When live trading
	* select 'Trading Mode' to 'Live Trading'
	* if the last current bar is end of period select 'Force End of Period'
*/

// Params
p_backtesting = ParamToggle("Trading Mode:", "Live Trading|Back Testing", defaultVal = 0);
p_currentMonthComplete = ParamToggle("(Back Testing Setting) Last Bar End of Period:", "Incomplete Month (NOT End of Period)|Last Bar is End of Month", defaultVal = 0);
p_lastBarEndOfPeriod = ParamToggle("(Live Trading Setting) Last Bar End of Period:", "Auto Detect|Force End of Period", defaultVal = 0);

if (Status("ActionEx") == actionExplore)
{
	bi = BarIndex();
	dow = DayOfWeek();
	dom = Day();
	lastBar_bi = BarCount - 1;
	onLastBar = bi == lastBar_bi;
	onCurrentMonth = Year() == LastValue(Year()) AND Month() == LastValue(Month());

	lastTradingDayOfWeek = Nz(TimeFrameExpand(True, inWeekly, expandPoint));
	lastTradingDayOfMonth = Nz(TimeFrameExpand(True, inMonthly, expandPoint));
	lastTradingDayOfWeek_bs = BarsSince(lastTradingDayOfWeek);

	monthlyDateDiff = DateTimeAdd(DateTime(), 1, inMonthly);
	monthlyDateDiff = DateTimeDiff(monthlyDateDiff, DateTime()) / 60 / 60 / 24;
	daysRemainingInMonth = monthlyDateDiff - dom;

	rotationBar = False;

	if (p_backtesting)
	{
		for (i = 7; i < BarCount; i++)
		{
			if (lastTradingDayOfMonth[i]) rotationBar[i - lastTradingDayOfWeek_bs[i]] = True;
			if (onCurrentMonth[i] AND NOT p_currentMonthComplete) rotationBar[i] = False;
		}
	}
	else rotationBar = (dow == 5 AND daysRemainingInMonth < 7) OR (p_lastBarEndOfPeriod AND onLastBar);

	Filter = IIf(p_backtesting, True, Status("lastBarInRange"));
	
	AddColumn(p_backtesting, "p_backtesting", 1.0);
	AddColumn(p_currentMonthComplete, "p_currentMonthComplete", 1.0);
	AddColumn(p_lastBarEndOfPeriod, "p_lastBarEndOfPeriod", 1.0);
	AddColumn(daysRemainingInMonth, "Days Remaining in Month", 1.0);
	AddColumn(dow, "Day of Week", 1.0, colorDefault, IIf(dow == 5, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfMonth, "Last Trading Day of Month", 1.0, colorDefault, IIf(lastTradingDayOfMonth, colorYellow, colorDefault));
	AddColumn(lastTradingDayOfWeek, "Last Trading Day of Week", 1.0, colorDefault, IIf(lastTradingDayOfWeek, colorOrange, colorDefault));
	AddColumn(BarsSince(LastTradingDayOfWeek), "BarsSince(LastTradingDayOfWeek)", 1.0);
	AddColumn(rotationBar, "Rotation Bar", 1.0, colorDefault, IIf(rotationBar, colorGreen, colorDefault));
	AddColumn(bi, "Bar Index", 1.0);
	AddColumn(BarCount, "Bar Count", 1.0);
	AddColumn(lastBar_bi, "Last Bar Index", 1.0);
	AddColumn(onCurrentMonth, "onCurrentMonth", 1.0);
	AddColumn(onLastBar, "onLastBar", 1.0);
	AddTextColumn(Interval(2), "Periodicity");
}

Hi @TrendSurfer

First of all, many thanks for your help, I appreciate your effort for me

Your last code looks better but there are still mistakes (in red)
forum

To check easily I filtered (rotationBar and dow!=5)

30/4/2009 instead of 24/4/2009 (=normal last friday of month)
31/12/2009 instead of 24/12/2009
30/4/2015 instead of 24/4/2015 (=normal last friday of month)
31/12/2015 instead of 24/12/2015
30/4/2020 instead of 24/4/2020 (=normal last friday of month)
24/12/2020 is missing

I'm interresting only in backtesting

I found a "solution", it's ugly but it works, I will prefer your code without the few errors mentionned above :wink:

           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);
           RotationDay=IIf(Daysinmonthfinal-Day()<7 AND DayOfWeek()==5,1,0);
           DaysToFriday = (5 - DayOfWeek() + 7) % 7;
           FridayNumber = Floor((Day() + DaysToFriday + 6) / 7);

// To solve Last Friday of month off so rotation day is Thursday

           RotationDay=IIf(DayOfWeek()==4 AND Ref(DayOfWeek(),1)!=5 AND FridayNumber>=4 AND NOT Ref(RotationDay,-4) AND NOT Ref(RotationDay,4) AND Ref(FridayNumber,1)!=2,1,RotationDay);

// To solve Last Friday of Month off, Thursday too, so rotation day is Wenesday

           RotationDay=IIf(DayOfWeek()==3 AND Ref(DayOfWeek(),1)!=4 AND FridayNumber==4 AND NOT Ref(RotationDay,-3) AND NOT Ref(RotationDay,3) AND Ref(FridayNumber,1)!=2,1,RotationDay);

Best regards

Thanks @didrip,

With my testing I only had two of your dates misaligning, did you have Pad & Align turned on?

I have made some changes to suit your logic.

Try this updated version to see if it is as required.

/*
Daily periodicity, Monthly rotation, Pad & Align checked, run 'Explore'.
Rotates on the last Friday of every month, if Friday is a non-trading day then previous trading day is the rotation day for that week.

When back testing
	* if the current months (last month in database) rotation day has NOT occured, select 'Back Testing: (Last Month - Do NOT Rotate [month too young])'
	* if the current months (last month in database) rotation day HAS occured, select 'Back Testing: (Last Month - Rotate [rotation day has occured])'

When live trading
	* when the current bar (last bar in database) is a rotation day, select 'Do Live Rotation (current bar is rotation day)'
*/

// Params
p_backtesting = ParamList("Trading Mode:", "Do Live Rotation (current bar is rotation day)" + "|" +
	"Back Testing: (Last Month - Do NOT Rotate [month too young])" + "|" +
	"Back Testing: (Last Month - Rotate [rotation day has occured])", defaultVal = 0);

if (Status("ActionEx") == actionExplore)
{
	bi = BarIndex();
	dow = DayOfWeek();
	dom = Day();
	mth = Month();
	lastBar_bi = BarCount - 1;
	onLastBar = bi == lastBar_bi;
	onCurrentMonth = Year() == LastValue(Year()) AND mth == LastValue(mth);

	lastTradingDayOfWeek = Nz(TimeFrameExpand(True, inWeekly, expandPoint));
	lastTradingDayOfMonth = Nz(TimeFrameExpand(True, inMonthly, expandPoint));
	lastTradingDayOfWeek_bs = BarsSince(lastTradingDayOfWeek);
	previousTradingDayOfWeek_bs = BarsSince(Ref(lastTradingDayOfWeek, -1));

	monthlyDateDiff = DateTimeAdd(DateTime(), 1, inMonthly);
	monthlyDateDiff = DateTimeDiff(monthlyDateDiff, DateTime()) / 60 / 60 / 24;
	daysRemainingInMonth = monthlyDateDiff - dom;
	
	backtesting = p_backtesting != "Do Live Rotation (current bar is rotation day)";
	lastMonthRotate = p_backtesting == "Back Testing: (Last Month - Rotate [rotation day has occured])";
	
	rotationBar_offset = 0;
	rotationBar = False;

	if (backtesting)
	{
		for (i = 7; i < BarCount; i++)
		{
			if (onCurrentMonth[i] AND NOT lastMonthRotate) break;
			
			rotationBar_offset = i - lastTradingDayOfWeek_bs[i];
			
			if (lastTradingDayOfMonth[i] AND mth[rotationBar_offset] == mth[i]) rotationBar[rotationBar_offset] = True;
			
			rotationBar_offset = i - (previousTradingDayOfWeek_bs[i] + 1);
			
			if (lastTradingDayOfMonth[i] AND lastTradingDayOfWeek[i] AND mth[rotationBar_offset] == mth[i] AND dow[i] != 5)
			{
				rotationBar[i] = False;
				rotationBar[rotationBar_offset] = True;
			}
		}
	}	
	else rotationBar = onLastBar;
	
	Filter = IIf(backtesting, True, Status("lastBarInRange"));
	
	AddColumn(backtesting, "backtesting", 1.0);
	AddColumn(lastMonthRotate, "lastMonthRotate", 1.0);
	AddColumn(daysRemainingInMonth, "Days Remaining in Month", 1.0);
	AddColumn(dow, "Day of Week", 1.0, colorDefault, IIf(dow == 5, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfMonth, "Last Trading Day of Month", 1.0, colorDefault, IIf(lastTradingDayOfMonth, colorYellow, colorDefault));
	AddColumn(lastTradingDayOfWeek, "Last Trading Day of Week", 1.0, colorDefault, IIf(lastTradingDayOfWeek, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfWeek_bs, "lastTradingDayOfWeek_bs", 1.0);
	AddColumn(previousTradingDayOfWeek_bs, "previousTradingDayOfWeek_bs", 1.0);
	AddColumn(rotationBar, "Rotation Bar", 1.0, colorDefault, IIf(rotationBar, colorGreen, colorDefault));
	AddColumn(bi, "Bar Index", 1.0);
	AddColumn(BarCount, "Bar Count", 1.0);
	AddColumn(onCurrentMonth, "onCurrentMonth", 1.0);
	AddColumn(onLastBar, "onLastBar", 1.0);
	AddTextColumn(Interval(2), "Periodicity");
}

Hi @TrendSurfer

First of all, my best wishes for 2021

I have checked, one by one this time, all the dates from 01/2000 to 12/2020, and I found only 3 errors (in red)
erreur1
erreur2
erreur3

22/03/2002 instead of 28/03/2002
22/03/2013 instead of 28/03/2013
23/03/2018 instead of 29/03/2018

May be linked to "Days Remaining in Month" greater than 7 ?

Anyway, previous erros are solved, that's great, THE solution is near :wink:
I didn't imagine that a such question is so complicated to solve :slight_smile:

In any case, thanks a lot for the time you're taken for me

Best regards

I forget to mention

YES it is

Thanks @didrip,

Made small change, please confirm if all ok now.

/*
Daily periodicity, Monthly rotation, Pad & Align checked.
Rotates on the last Friday of every month, if Friday is a non-trading day then previous trading day is the rotation day for that week.

When back testing
	* if the current months (last month in database) rotation day has NOT occured, select 'Back Testing: (Last Month - Do NOT Rotate [month too young])'
	* if the current months (last month in database) rotation day HAS occured, select 'Back Testing: (Last Month - Rotate [rotation day has occured])'

When live trading
	* when the current bar (last bar in database) is a rotation day, select 'Do Live Rotation (current bar is rotation day)'
*/

// Params
p_backtesting = ParamList("Trading Mode:", "Do Live Rotation (current bar is rotation day)" + "|" +
	"Back Testing: (Last Month - Do NOT Rotate [month too young])" + "|" +
	"Back Testing: (Last Month - Rotate [rotation day has occured])", defaultVal = 0);

if (Status("ActionEx") == actionExplore OR Status("ActionEx") == actionBacktest)
{
	bi = BarIndex();
	dow = DayOfWeek();
	dom = Day();
	mth = Month();
	lastBar_bi = BarCount - 1;
	onLastBar = bi == lastBar_bi;
	onCurrentMonth = Year() == LastValue(Year()) AND mth == LastValue(mth);

	lastTradingDayOfWeek = Nz(TimeFrameExpand(True, inWeekly, expandPoint));
	lastTradingDayOfMonth = Nz(TimeFrameExpand(True, inMonthly, expandPoint));
	lastTradingDayOfWeek_bs = BarsSince(lastTradingDayOfWeek);
	previousTradingDayOfWeek_bs = BarsSince(Ref(lastTradingDayOfWeek, -1));

	monthlyDateDiff = DateTimeAdd(DateTime(), 1, inMonthly);
	monthlyDateDiff = DateTimeDiff(monthlyDateDiff, DateTime()) / 60 / 60 / 24;
	daysRemainingInMonth = monthlyDateDiff - dom;
	
	backtesting = p_backtesting != "Do Live Rotation (current bar is rotation day)";
	lastMonthRotate = p_backtesting == "Back Testing: (Last Month - Rotate [rotation day has occured])";
	
	rotationBar_offset = 0;
	rotationBar = False;

	if (backtesting)
	{
		for (i = 7; i < BarCount; i++)
		{
			if (onCurrentMonth[i] AND NOT lastMonthRotate) break;
			
			rotationBar_offset = i - lastTradingDayOfWeek_bs[i];
			
			if (lastTradingDayOfMonth[i] AND mth[rotationBar_offset] == mth[i]) rotationBar[rotationBar_offset] = True;
			
			rotationBar_offset = i - (previousTradingDayOfWeek_bs[i] + 1);
			
			if (lastTradingDayOfMonth[i] AND lastTradingDayOfWeek[i] AND mth[rotationBar_offset] == mth[i] AND dow[i] != 5)
			{
				if (daysRemainingInMonth[i] > 0 AND daysRemainingInMonth[i] < 4)
					rotationBar[i] = True;
				else
				{
					rotationBar[i] = False;
					rotationBar[rotationBar_offset] = True;
				}
			}
		}
	}	
	else rotationBar = onLastBar;
	
	Filter = IIf(backtesting, True, Status("lastBarInRange"));
	
	AddColumn(backtesting, "backtesting", 1.0);
	AddColumn(lastMonthRotate, "lastMonthRotate", 1.0);
	AddColumn(daysRemainingInMonth, "Days Remaining in Month", 1.0);
	AddColumn(dow, "Day of Week", 1.0, colorDefault, IIf(dow == 5, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfMonth, "Last Trading Day of Month", 1.0, colorDefault, IIf(lastTradingDayOfMonth, colorYellow, colorDefault));
	AddColumn(lastTradingDayOfWeek, "Last Trading Day of Week", 1.0, colorDefault, IIf(lastTradingDayOfWeek, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfWeek_bs, "lastTradingDayOfWeek_bs", 1.0);
	AddColumn(previousTradingDayOfWeek_bs, "previousTradingDayOfWeek_bs", 1.0);
	AddColumn(rotationBar, "Rotation Bar", 1.0, colorDefault, IIf(rotationBar, colorGreen, colorDefault));
	AddColumn(bi, "Bar Index", 1.0);
	AddColumn(BarCount, "Bar Count", 1.0);
	AddColumn(onCurrentMonth, "onCurrentMonth", 1.0);
	AddColumn(onLastBar, "onLastBar", 1.0);
	AddTextColumn(Interval(2), "Periodicity");
}

Hi @TrendSurfer

Previous errors are corrected :slight_smile: but your last code introduces 6 new errors (in red) that aren't in your previous code :frowning:
err1
err2
err3

30/04/2009 instead of 24/04/2009
31/12/2009 instead of 24/12/2009
30/04/2015 instead of 24/04/2015
31/12/2015 instead of 24/12/2015
30/04/2020 instead of 24/04/2020
31/12/2020 instead of 24/12/2020

That's a nightmare :wink:

@didrip,

On my tests I don't have any dates that are misaligned.

I notice on your report all your misaligned dates are when days remaining in the month are zero yet my code has this line if (daysRemainingInMonth[i] > 0 ...

Please re-check and let me know.

image

image

Hi @TrendSurfer

I confirm the code is right, I did a copy/paste and I confirm the errors :frowning:

Thanks @didrip,

I ran my results again and it all seems ok (see below).

Maybe check that the symbol you have Pad & Align to has clean data?

If you find no issues with your Pad & Align data then please post up Explore results for all days for December 2015 and for all days for April 2020.

Thanks.

image

image

@TrendSurfer, please find here what you request and more

pad

April 2009
2009_04
December 2009
2009_12
April 2015
2015_04
December 2015
2015_12
April 2020
2020_04
December 2020
2020_12

Same result with any other stocks
Hope this will help you to solve this mystery

Thanks a lot
Best regards

With the help of @didrip running tests for me at his end, the issue was on my PC ‘daysRemainingInMonth’ was returning integers [0.0000000] (as expected) and on @didrip's PC ‘daysRemainingInMonth’ was returning fractions [0.0000057] (not expected). Hence giving different results.

So adjusted code here.

/*
Daily periodicity, Monthly rotation, Pad & Align checked.
Rotates on the last Friday of every month, if Friday is a non-trading day then previous trading day is the rotation day for that week.

When back testing
	* if the current months (last month in database) rotation day has NOT occured, select 'Back Testing: (Last Month - Do NOT Rotate [month too young])'
	* if the current months (last month in database) rotation day HAS occured, select 'Back Testing: (Last Month - Rotate [rotation day has occured])'

When live trading
	* when the current bar (last bar in database) is a rotation day, select 'Do Live Rotation (current bar is rotation day)'
*/

// Params
p_backtesting = ParamList("Trading Mode:", "Do Live Rotation (current bar is rotation day)" + "|" +
	"Back Testing: (Last Month - Do NOT Rotate [month too young])" + "|" +
	"Back Testing: (Last Month - Rotate [rotation day has occured])", defaultVal = 0);

if (Status("ActionEx") == actionExplore OR Status("ActionEx") == actionBacktest)
{
	bi = BarIndex();
	dow = DayOfWeek();
	dom = Day();
	mth = Month();
	lastBar_bi = BarCount - 1;
	onLastBar = bi == lastBar_bi;
	onCurrentMonth = Year() == LastValue(Year()) AND mth == LastValue(mth);

	lastTradingDayOfWeek = Nz(TimeFrameExpand(True, inWeekly, expandPoint));
	lastTradingDayOfMonth = Nz(TimeFrameExpand(True, inMonthly, expandPoint));
	lastTradingDayOfWeek_bs = BarsSince(lastTradingDayOfWeek);
	previousTradingDayOfWeek_bs = BarsSince(Ref(lastTradingDayOfWeek, -1));

	monthlyDateDiff = DateTimeAdd(DateTime(), 1, inMonthly);
	monthlyDateDiff = DateTimeDiff(monthlyDateDiff, DateTime()) / 60 / 60 / 24;
	daysRemainingInMonth = int(monthlyDateDiff - dom);
	
	backtesting = p_backtesting != "Do Live Rotation (current bar is rotation day)";
	lastMonthRotate = p_backtesting == "Back Testing: (Last Month - Rotate [rotation day has occured])";
	
	rotationBar_offset = 0;
	rotationBar = False;

	if (backtesting)
	{
		for (i = 7; i < BarCount; i++)
		{
			if (onCurrentMonth[i] AND NOT lastMonthRotate) break;
			
			rotationBar_offset = i - lastTradingDayOfWeek_bs[i];
			
			if (lastTradingDayOfMonth[i] AND mth[rotationBar_offset] == mth[i]) rotationBar[rotationBar_offset] = True;
			
			rotationBar_offset = i - (previousTradingDayOfWeek_bs[i] + 1);
			
			if (lastTradingDayOfMonth[i] AND lastTradingDayOfWeek[i] AND mth[rotationBar_offset] == mth[i] AND dow[i] != 5)
			{
				if (daysRemainingInMonth[i] > 0 AND daysRemainingInMonth[i] < 4)
					rotationBar[i] = True;
				else
				{
					rotationBar[i] = False;
					rotationBar[rotationBar_offset] = True;
				}
			}
		}
	}	
	else rotationBar = onLastBar;
	
	Filter = IIf(backtesting, True, Status("lastBarInRange"));
	
	AddColumn(backtesting, "backtesting", 1.0);
	AddColumn(lastMonthRotate, "lastMonthRotate", 1.0);
	AddColumn(daysRemainingInMonth, "Days Remaining in Month (Int)", 1.0);
	AddColumn(dow, "Day of Week", 1.0, colorDefault, IIf(dow == 5, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfMonth, "Last Trading Day of Month", 1.0, colorDefault, IIf(lastTradingDayOfMonth, colorYellow, colorDefault));
	AddColumn(lastTradingDayOfWeek, "Last Trading Day of Week", 1.0, colorDefault, IIf(lastTradingDayOfWeek, colorOrange, colorDefault));
	AddColumn(lastTradingDayOfWeek_bs, "lastTradingDayOfWeek_bs", 1.0);
	AddColumn(previousTradingDayOfWeek_bs, "previousTradingDayOfWeek_bs", 1.0);
	AddColumn(rotationBar, "Rotation Bar", 1.0, colorDefault, IIf(rotationBar, colorGreen, colorDefault));
	AddColumn(bi, "Bar Index", 1.0);
	AddColumn(BarCount, "Bar Count", 1.0);
	AddColumn(onCurrentMonth, "onCurrentMonth", 1.0);
	AddColumn(onLastBar, "onLastBar", 1.0);
	AddTextColumn(Interval(2), "Periodicity");
}
2 Likes