Looking at your code, I suggest making use of OrderCloseTime(), TimeDayOfYear() and DayOfYear() functions will be neater, as follows (code segment that could go inside the "for" loop of your Winner() function):
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY); datetime T = OrderCloseTime(); if (TimeDayOfYear(T)!=DayOfYear()) //since the last order was closed on a different day, there is no need to check further. break; if (OrderProfit()<0) //with the above time check, you can continue to check for the 2nd last order as well. continue; else Contador++; if (Contador==2) break;
as for the checks to make sure that the current time is within the Trade Hours, I think they can go into a separate function, or included in your main code body. Also, do check that "Current_Time >= Start_Trade_Hours && Current_Time <Start_Trade_Hours" is erroneous.
Looking at your code, I suggest making use of OrderCloseTime(), TimeDayOfYear() and DayOfYear() functions will be neater, as follows (code segment that could go inside the "for" loop of your Winner() function):
as for the checks to make sure that the current time is within the Trade Hours, I think they can go into a separate function, or included in your main code body. Also, do check that "Current_Time >= Start_Trade_Hours && Current_Time <Start_Trade_Hours" is erroneous.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I have my two Count Function to Winner trade and to Losses Trade
But I want to know if is possible modify the Count Function to do this if I have two Losses or Winner consecutive trade
and if is DayOfTheWeek ()==1 , and Next Session trade is DayOfTheWeek ()==2 The Count, ComeBack to 0 and my
Condition Function Start To Work Again day by day
I show you My Condition that work fine but if get two win o losses trade the EA don't work more
then I want to modify the Count Function to do this if I have two Losses or Winner consecutive tradeand if is DayOfTheWeek ()==1 , and Next Session trade is DayOfTheWeek ()==2 The Count, ComeBack to 0
Like this
I need Help What I have to do, which is the easier or What ?