Who is your broker?
This EA is written for a instant execution broker(market maker)......if your broker is an ECN/STP, then the EA will test but not work live.
What errors are in the Experts or Journal tab?
-BB-
You have a lot of courage to open an "Auto trading" company using your clients money to test your EA's, when you actually doesn't even know how to code.
kennyhubbard:
This EA is written for a instant execution broker(market maker)......if your broker is an ECN/STP, then the EA will test but not work live.
//++++ These are adjusted for 5 digit brokers. double pips2points, // slippage 3 pips 3=points 30=points pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits == 5 || Digits == 3){ // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
I hate to say this, but these guys are right. Try this, go to the Code Base section of this forum and drill through 10 different existing programs, 3 scripts, 3 indicators, and 4 EAs. when you are done, note everything you have learned, then go to the Code Base section of this forum and drill through 10 different existing programs, 3 scripts, 3 indicators, and 4 EAs.
After you have done this a few times, you should have a fair hang of th codiong.
The suggestions that the others have made is the solution to your problem for your code. Here is a simple snippet that will help, but you first need to identify if your user is using ECN or not. For example, if they are ECN, the EURUSD will have a number like this 1.12345, but if it is not ECN, it will have a number like this: 1.1234, notice the difference in the decimal values? The coding that WHRoeder gave you will help you to iron that out. Anytime you need to make sure a value is in the right decimal value (is or is not ECN) you will have to use that code to adjust the values correctly.
Now if you are not getting trades in forward test, but you are getting them in back test, this is because back tester does not allow you to change ECN settings, thus it never trades ECN (the extra digit). So it does not pick up on that. I actually thought of writting a code snippet that will detext the users ECN, I just never got around to it.
Now how do you fix the code. Well, those who use ECN brokers also do not allow you to submit Stop losses and Take Profits in the same OrderSend statement, so you have to initialize the OrderSend with these values set to 0. Then perform a ModifyOrder command to add them in, in some cases, you have to submit a ModificationOrder for each the stop loss and the take profit. We force this to happen in the beginning loop of our code. The lazy pseudo code for this is similar to the following:
OrderSend(pass all valus, but SL and TP = 0)
OrderModify(TicketID of the above ticket and SL value)
OrderModify (TicketID of the above ticket and the TP value)
the end.
ECN and 5 digits are two separate problems, you must handle both independently. OrserSend with TP=0, SL=0) then one orderModify with both TP, SL.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
it is my first ea, it works on the back testing but does not work on live. why any suggestions? it's make money on the back teting i hope it will do the same at the reall market
thank yall