I would prefer the second option - we could choose then (true/false) the use of this brief Sunday candle - mostly I think we would excluse this candle ?
SIMPLE EA for a simple method needed!! 2 replies
Trading is this Simple? Finally Explained simple and clearly! 46 replies
Simple 3 order GBPUSD EA 1,047 replies
Experiment with "Simple H1 GBPUSD EA" 4 replies
Simple 5m GBPUSD trade system 10 replies
DislikedI would prefer the second option - we could choose then (true/false) the use of this brief Sunday candle - mostly I think we would excluse this candle ?Ignored
DislikedHi Mandl,
I do not want to muddy the waters with too many versions of this EA and I am sure Piptician will see to this when he gets time, but if you would like to add this option to one of the open source versions, put the following code directly after the Start() open brace "{" :
if (UseSundayCandle == false)
{
if (DayOfWeek() == 0)
{
return;
}
}
and add the following extern to the externs at the top of the mq4 file:
extern bool UseSundayCandle = false;
RickIgnored
DislikedIs the problem always going to be Sunday for everyone ? Depending on where in the world you are i.e. GMT time difference, it's possible you may not want it to trade on Saturday rather than Sunday ...
I'll add this to my ToDo list
Regards,
PipticianIgnored
DislikedHi Piptician,
Hmmm. TimeOfDay() returns server time which is based on GMT, so Sunday GMT should always be Sunday GMT whereever you are, but I am writing this not having consumed nearly enough coffee, so I will give it a bit more thought. Thanks for making me think
RickIgnored
DislikedSorry, I meant server time not the local time for the user. If server time is GMT minus anything then that makes it Saturday ???
PipticianIgnored
DislikedSorry, I meant server time not the local time for the user. If server time is GMT minus anything then that makes it Saturday ???
PipticianIgnored
DislikedIf you are planning on adding this to the EA why not just disable it for the
brokers that are known to have the Sunday bar!
There are more brokers that don't have this than do!Ignored
DislikedI think something like this will do the trick without having to maintain a list of Sunday brokers:
if((GMToffset < 0 && DayOfWeek() == 6) || // 6 = Saturday
(GMToffset >= 0 && DayOfWeek() == 0)) // 0 = Sunday
return(0); // No trade today!
PipticianIgnored
DislikedSure, that can be wrapped in a check for a user option. Probably best that the user option defaults to true so by default Saturdays/Sundays are avoided.
PipticianIgnored
DislikedGood solution. I posted some code above which will exclude any day the user chooses. Could be useful on BOE interest decision days
RickIgnored
DislikedPoint well taken. Sorry for meddling.
I will leave it in the capable hands of Piptician.
RickIgnored
DislikedGetting not so simple anymore. I am sure that everyone knows how to disable the EA so it does not trade on Sunday. Next they will want this EA to wash their car.Ignored
DislikedSorry guys but I don't think the default should be to disable the Sat/Sun candle
as there would appear to be only 2 brokers that have this particular anomally
so it would seem to me that the default should favour the majority that do not!
Bear in mind the EA only trades twice per week on average, if we cut the week
down to 4 trading days this average is going to be reduced even more!Ignored
DislikedGetting not so simple anymore. I am sure that everyone knows how to disable the EA so it does not trade on Sunday. Next they will want this EA to wash their car.Ignored