You probably need to get rid of that return(0) immediately after int start(){
yes thank you sir..it can...but it make 10 trades consecutive.......how to make it only 1 trade perday...
i think need to add this logic...but where to put.....
bool isNewDay()
{static int dow = -1;
if (dow != Day())
{
dow = Day();
return(true);
}
return(false);
}
This can be improved, but it should give you the idea... bool AlreadyTookATradeToday = false; int start(){ for(i = OrdersTotal()-1; i >= 0; i--){ OrderSelect(i, SEL_BY_POSITION, MODE_TRADES){ if(OrderSymbol() == OrderSymbol()){ if(TimeDayOyYear(OrderOpenTime()) == TimeDayOfYear(TimeCurrent()){ AlreadyTookATradeToday = true; } } } ... ... your code above if(AlreadyTookATradeToday == false) OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,txComment,MagicNumber); ... if(AlreadyTookATradeToday == false) OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,txComment,MagicNumber); ... ... AlreadyTookATradeToday = false; // reset the flag at the end return(0) }
thank you very much sir.....i will try.....

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i am on my way to learn mql4...but it is so difficult......so itry to combine from 1 EA to another EA to create my EA...
i want my EA work at specific time...like example at 12.00 it will buy or sell and only doing 1 trade perday....and also added SMA that is 175 SMA, the rule when SMA upp than the price, it will order sell at the specific time and only once......and on the contrary
here is my code........please help me...