EA will not trade - page 2

 
WHRoeder:

A year ago you were on a 4 digit non-ECN broker. Now you are not.

  1. You didn't check return code before and you still aren't as requested.
  2. You are still useing OrderOpenPrice you can't
  3. You're not modify tp, sl and SLIPPAGE for 5 digit brokers.

If you're not going to modify your code when we answer your question, NOBODY can help you.


OK. I wanted to get the format of the code to display correctly here so it would be easier to read....sorry. Originally I contracted to have this strategy coded and tweaked it from there. I never coded in "C", only VB and a little SQL so I'm kinda going by the seat of my pants here. I can see I should put an else for iTicket not >0 and will look up return code on how to display it. I also will investigte OrderOpenPrice, its function, what happened to it and how to replace it. As for the 5 digit thing, I check Digits in a routine in the initialization function before the main section and adjust SL and TP, which are multipliers, to either 1 or 10 accordingly. I will check if I covered Slippage. Also, I believe Forex.com is a non-ECN broker. Don't mean to come off like an ingrate...I will do my homework and get back...
 
I got it to work. I was in the process of including code to display the return code (it was error 130) which led me to the following: I use Forex.com which is not an ECN broker, and by the settings in my contracted out EA a non ECN trade has the actual open and set SL and TP in one line. The MT4 platform can't do this, so when I use ordersend to open the trade with 0 for sl and 0 for tp, and then ordermodify to set the sl and tp, it works.... The thing that confounds me however, is that this EA worked fine a year ago using the same code. But thanks just the same to everyone who kicked my butt in order to get me to discover this....
Reason: