it is works fine with the strategy tester "no problem" ... the only thing it doesn't execute trades automatically in case of live trading, but if i activate the manual confirmation it works!!!
I thought there was some thing wrong in meta trader but i tried to do for another broker and got the same results !!
Maybe it's a Broker thing, try a Demo from a different Broker and see if it does the same . . . there are 2 places you can set this option . . .
it is works fine with the strategy tester "no problem" ... the only thing it doesn't execute trades automatically in case of live trading, but if i activate the manual confirmation it works!!!
Thanks RaptorUK ... but i am already doing the same options you attached, it seems very strange because i got no error and if you just looked at the code .. it going directly to
LastTrade = Buy; SendMail ("BUY "+Symbol(),"1st Buy Excuted"); PlaySound ("news.wav"); return;
and skip
res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Bid,3,(SELL_PRICE-(Commission*Point)),(BUY_PRICE+(TARGET*Point)),"",MAGICMA,0,Blue);
this is only if i just "Allow live trading"
but if i "Allow live trading" + "Ask manual confirmation" it will not skip any thing and give me a pop up for confirmation "Buy/Sell" then it will send the mail and generate the alarm.
Do I have to repeat a third time what I have already said twice ? I guess I don't . . .
I didn't force you to answer ... if you have no idea or don't know the correct answer then you should ignore and look at another topic you might know
OK, I'll write your code for you . . .
res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Bid,3,(SELL_PRICE-(Commission*Point)),(BUY_PRICE+(TARGET*Point)),"",MAGICMA,0,Blue); if(res<0) { int GLE = GetLastError(); Print("OrderSend failed, error: ", GLE); SendMail("BUY "+Symbol(), StringConcatenate("OrderSend failed, error: ", GLE)); } else { LastTrade = Buy; SendMail ("BUY "+Symbol(),"1st Buy Excuted"); }
Add this to your code, turn off manual confirmation, wait for a trade to try to happen, check the Experts tab and your email for the error . . .
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My EA will not work unless i check the (Allow Live Trading) + (Manual Confirmation)
If I just check the (Allow Live Trading) it will do nothing ... just skip the step of OrderSend() and generate an alarm!!
do i need to add some sleep time or what?