Need help with custom EA

I created a test EA using the free EA builder web site: xxxx: // sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Once I put it in the EA folder I was able to add it to a chart and could see the smily face, but doesn’t do any trades. When I tried to do a stratergy tester it doesn’t do anything either. When I checked the journal I see the following error:
Yourexpertadvisor EURUSD,1H : OrderSend error 130

I am not sure how to fix this. Could anyone help please? I have attached the EA.

YourExpertAdvisor.zip (1.9 KB)

I think the problem is the broker is an ECN/STP platform - perhaps you can confirm. With this type of broker, you cannot set the SL/TP when opening the trade. The trade has to be opened then modified. Its not easy for a non-programmer. It seems as if the EA builder doesn’t have an option for this or at least I couldn’t find one. So you will have to open trades in the EA without SL/TP and manually update them or find a new broker.

My account is with Alapri and they do have the option of setting S/L when creating a new trade.

I guess you will to contact the EA builder site and ask for help or find another EA builder.

For whatever reason it started to work now, but the problem is it executes the trade when ever the condition is true. What I want it to execute the trade only the moment the indicators cross. Is this possible? If so could someone give me an example please?

What you are asking for is a bit tricky to do, but I have done it.

You should contact the EA builder site and ask for assistance or find another EA builder that has the option you need.

Thanks a lot for the replies. Much appreciated. Since I already had some code, I thought it will be easier to make few modifications and make work the way I want.

Hi i see that your using two SMA crossovers for Buy and two for sell namely 14>30 & 30 >40 for buy and vice versa for sell…and exit trades at counter signals right?

but the problem is it executes the trade when ever the condition is true. What I want it to execute the trade only the moment the indicators cross. Is this possible?

From what you have asked it is not possible because during the formation of candles the price swings to & fro…so what may be a cross at X:XX time wont be a cross at X:YY which results in a false signal…but if you look at offline charts…it may seem that the cross had never occurred…but it did…moreover the EA should be executed once per bar & not every tick…to avoid false signals… but then again you’ll be very late at the entry of a trade besides MA is a very lagging indi…no wonder that crosses occur after the movement took place

And also think of this
buy when 14>30 (current bar) && 14<30 (previous bar) i.e Buy cross confirmed
sell when 14<30 (current bar) && 14>30 (previous bar) i.e Sell cross confirmed