for(cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderMagicNumber() == MagicNumber) Bought++; } if(Bought==0){ //no order yet if(OrderSignal > 0){ // buy order Vol=Lots; Ticket=OrderSend(Symbol(),OP_BUY,Vol,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Daily100",MagicNumber,0,Green); } if(OrderSignal < 0){ // sell order Vol=Lots; Ticket=OrderSend(Symbol(),OP_SELL,Vol,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Daily100",MagicNumber,0,Red); } }
After your first order, Bought is incremented on each tick, as the magic number is found in the order pool.
Therefore, Bought no longer is equal to 0.
Then what?
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
The attached EA is just a very simple one and is producing signals, but the orders are not being entered and NO ERRORS are showing up in the Journal.
What it should do is every time the current price crosses UP or DOWN on the EMA 89 it would place an order in the direction of the cross.
It places the first one then no more orders.
You can see in the Journal there are plenty of signals being triggered when you run it.
PLEASE HELP!
Thanks in advance.
Neal