Hi guys, i just tried made some EA and when i tried it out on strategy tester, it worked out great, i mean it works, there’s a results of win and losing. However when i tried it on demo account, i left computer on for whole night but my EA doesn’t execute any order at all? Am i missing something here?
FYI : i am converting my regular indicator to EA, and i am using 5 minutes charts. Smiley face already appear on Top right corner. and since i am converting my indicator to EA, it should have some order because my indicator already gave alot signal at night.
How often did your EA trade in the backtest, and during what trading hours? Are there any trading conditions that must be met for a trade to be initialized? (aka spread, trending marketing, ect). If no problems there and the perfect conditions existed overnight I’d wonder about my MQL4 code and how it interacts with the broker.
Just throwing some ideas out there, but then again…some of the EA I run dont trade for days at a time…
This is really weird, i am trying to convert my indicator to EA, and my indicator already gave signal to sell but my EA which is suppose to open a trade didn’t do anything. is there anyway to trace the EA, to know what i am missing here?
I am creating EA using EA Builder, is the code generated from there really working?
1 - backtesting allows use of Stop and Tp levels when testing, but then when “live” do not allow this /// mine only allows 0.00 for both stop and take profit - try :: allowing opening an order with 0.00 then do an ordermodify next to set your stop and take profit
2- number of digits? (I struggle with this one) so no advice, but something to look at if #1 doesn’t work.
3- convert indicator to EA - maybe wrong folder? inicators are not found in the ‘experts’ folder?
Thanks for the reply, i just email my broker and asked them the condition about their platform, and they reply saying that make sure my ea can work on market execution and do not place SL and TP at ordersend.
So what is that mean about market execution thing? did the ea builder at Expert Advisor Builder for MetaTrader 4 doesn’t execute on market execution?
Hey it worked now, it open a trade after i empty SL and TP.
So now the next question is, is it possible to modify SL and TP after the trade is open? and if yes could anybody share the script please or point me to the right direction?
Whenever you open a trade at ‘[I]Market Execution[/I]’ (ECN broker), it is not possible to enter S/L and T/P right away.
The opened trade has to be modified, in order to add these levels to the position, so all you have to do is make your EA do that … not hard to add this to your code.
It’s good to hear that all seems to be working well now.
Happy trading.
Thanks. But it’s not 100% correct. It could modify the order but sometimes it doesnt modify too. Does the EA execute at the end of bar or beginning of the bar? If thats true then i have to wait for another bar for it to modify the order then?
I don’t know how you have set up your EA, but it can execute at any time. You definitely do not have to wait for another bar to modify your order … imagine what that would mean, if your EA traded on H4 or D1 timeframes.
As soon as a position has been opened, S/L and T/P can be modified, no matter the bar status.
However you must observe the minimum distance between current market price and S/L & T/P, as specified by your broker. If the values your EA attempts to set are too close to current price, the S/L or T/P will not be modified.
Okay so the code i put above doesn’t work, i dont know why, but maybe it can’t modify right after open, so i edit my program like below but still doesn’t work too. so can anybody tell me why it doesn’t work? is it the if ((OrderStopLoss() == 0.0) && (OrderTakeProfit() == 0.0)), maybe i should do this instead if ((OrderStopLoss() == 0) && (OrderTakeProfit() == 0))? or are both the same? i know that the trailing is working, and some of order modify on buying is working too thats why i said sometimes it work, sometimes it doesn’t, so i’m clueless here guys…
I found the culprit, it’s the point value, my SL and TP after calculating is too small, thats why it doesn’t execute the ordermodify function. so just to be clear what is the return value for point exactly? it’s different for every currency right? like for eurusd is 0.00001, usdjpy is 0.001. so how to solve this? don’t tell me i have to create different EA for every currency.
Unfortunately I don’t know enough about coding to give any advice here.
Regarding 5-digit and 3-digit currencies, I’m running an EA that handles both, although I don’t know how it is done.
I have seen indicator code using ‘IF’ function to handle 4/5-digit brokers, so I guess it could work along those lines … but I’m too noob at coding to be sure.
The best thing would be to register with MQL4: automated trading forum, I guess … there are many really good coders there who can advise you, and the website has extensive MQL4 documentation and courses, too.