I am attempting to have another shot at detecting the 4 trading days prior to NFP for any month.
Using the built in functions and the DaysOfMonth() available on the forum I have an idea.
I have an external variable ExcludeDaysBeforeNFP() that can be set from 1 to 4. with 4 meaning it should not trade any of the 4 Trading days before NFP. Using logic as follows.
For example, If the days in the month equal 31 and the day of the month equals 28 and the day of the week is a Monday Then it is 4 days before NFP.
So we can decide to not trade that day.
externint ExcludeDaysBeforeNFP = 0; // set between 1 and 4bool TradeToday = true;
int DaysPrior = 0;
if (DaysOfMonth() == 31 && Day() == 28 && DayOfWeek() == 1)
{
DaysPrior = 4;
}
if (ExcludeDaysBeforeNFP==DaysPrior)
{
return(0); //TradeToday = false; // do not trade this day
}
Assuming that the above logic will work.... my problem is that it will need quite a few lines of code to check the differrent variations and i am wondering if there is a better method?
I am attempting to have another shot at detecting the 4 trading days prior to NFP for any month.
Using the built in functions and the DaysOfMonth() available on the forum I have an idea.
I have an external variable ExcludeDaysBeforeNFP() that can be set from 1 to 4. with 4 meaning it should not trade any of the 4 Trading days before NFP. Using logic as follows.
For example, If the days in the month equal 31 and the day of the month equals 28 and the day of the week is a Monday Then it is 4 days before NFP.
So we can decide to not trade that day.
Assuming that the above logic will work.... my problem is that it will need quite a few lines of code to check the differrent variations and i am wondering if there is a better method?