Anyway, so, now we got (another) lesson.
I think all ZP users here got that loss.
One of my ZP accounts din't got that loss, bcz it closed a basket earlier - but that was preumably only luck !
I don't post often, but thought I would wade in here:).AGT » Sat May 09, 2015 4:03 am wrote:I let it run during the NFP. It could better perform switching off the EA.
Anyway, so, now we got (another) lesson.
I think all ZP users here got that loss.
One of my ZP accounts din't got that loss, bcz it closed a basket earlier - but that was preumably only luck !
Code: Select all
if(!Trade_NFP_Friday && DayOfWeek()==5 && Day()<=7)//is it the first friday of the month?
{
CanTrade=false;
}
Brilliant idea. Thanks. I will indeed incorporate it.AnotherBrian » Sat May 09, 2015 5:19 pm wrote:NFP code if anyone is interested in incorporating it. I use this on almost all of my bots.
This will prevent new trades from opening. You'll have to figure out if you want open trades to close or not.
Up to big Steve if he wants to incorporate.
Code: Select all
if(!Trade_NFP_Friday && DayOfWeek()==5 && Day()<=7)//is it the first friday of the month? { CanTrade=false; }
Last weeks' NFP was on Friday, the 8th. Not sure what the rule is. Is there ever a NFP on Friday the 1st? If not "Day() <=7" should become "Day()>=2 && Day()<=8"AnotherBrian » Sun May 10, 2015 3:19 am wrote:NFP code if anyone is interested in incorporating it. I use this on almost all of my bots.
This will prevent new trades from opening. You'll have to figure out if you want open trades to close or not.
Up to big Steve if he wants to incorporate.
Code: Select all
if(!Trade_NFP_Friday && DayOfWeek()==5 && Day()<=7)//is it the first friday of the month? { CanTrade=false; }
Good point.renexxxx » Sat May 09, 2015 9:28 pm wrote:Last weeks' NFP was on Friday, the 8th. Not sure what the rule is. Is there ever a NFP on Friday the 1st? If not "Day() <=7" should become "Day()>=2 && Day()<=8"AnotherBrian » Sun May 10, 2015 3:19 am wrote:NFP code if anyone is interested in incorporating it. I use this on almost all of my bots.
This will prevent new trades from opening. You'll have to figure out if you want open trades to close or not.
Up to big Steve if he wants to incorporate.
Code: Select all
if(!Trade_NFP_Friday && DayOfWeek()==5 && Day()<=7)//is it the first friday of the month? { CanTrade=false; }
Converting this rule to MQL we get something like this:WikiPedia wrote:The Bureau of Labor Statistics releases preliminary data on the third Friday after the conclusion of the reference week, i.e., the week which includes the 12th of the month, at 8:30 a.m. Eastern Time;[5] typically this date occurs on the first Friday of the month.
Code: Select all
bool isNFP(datetime date=-1) {
static const int DAY = 60*60*24;
static const int WEEK = 7*DAY;
datetime thisDate = (date < 0) ? iTime(Symbol(),PERIOD_D1,0) : date;
bool nfp = false;
if ( TimeDayOfWeek(thisDate) == 5 ) {
// So, the given date is a Friday. Go back three weeks and see if the 12th falls in that week
datetime dateStart = thisDate - 5*DAY - 3*WEEK; // This would be a SUNDAY three weeks ago
datetime dateEnd = dateStart + 1*WEEK;
for(datetime iDay = dateStart; iDay < dateEnd; iDay += DAY) {
if ( TimeDay(iDay) == 12 ) {
nfp = true;
break;
}
}
}
return(nfp);
}Niceplateman » 11 May 2015, 12:16 wrote:So far this bot seems fairly resilient, I note that a few on here had losses on Friday, I assume that they have a SL on their trades. I trade live with no SL/TP on the trades, a 3% basket closure and a 15% shirt protection.
Friday it went about 9% down but recovered for a 3% basket closure this morning.