confirm a trade

 

hey, I'm occuring a persistent problem here with my eas,

the mecanics within them is working perfectly as I want but I wonder how to actually make it confirm that it really took a trade or close a trade before continuing on it's way.

is there anything I could do because it freneticly takes several orders within a few minutes. thank you for any help

 
liquidd:

hey, I'm occuring a persistent problem here with my eas,

the mecanics within them is working perfectly as I want but I wonder how to actually make it confirm that it really took a trade or close a trade before continuing on it's way.

is there anything I could do because it freneticly takes several orders within a few minutes. thank you for any help

Do you check the return values from your trading functions ? OrderSend() returns the ticket number, if there is no ticket number there is no trade, read this : What are Function return values ? How do I use them ?
 
RaptorUK:
Do you check the return values from your trading functions ? OrderSend() returns the ticket number, if there is no ticket number there is no trade, read this : What are Function return values ? How do I use them ?


funny cuz I just whent trough this crossed reference! so please correct me if I'm completely wrong (I could manage small errors in the way I place it I just want to know if I got the global thing)

variable = OrderSend(values);

if (variable = -1) <something that goes back to where it was>;

if (variable != -1) <keep on going>;

right?

 
liquidd:


funny cuz I just whent trough this crossed reference! so please correct me if I'm completely wrong (I could manage small errors in the way I place it I just want to know if I got the global thing)

variable = OrderSend(values);

if (variable = -1) <something that goes back to where it was>;

if (variable != -1) <keep on going>;

right?

No, not right . . . you need to know what the error was and take the appropriate corrective measures, they are spelled out in the documentation covering the errors . . . Trading Errors

For example,

error 131 - "All attempts to trade must be stopped, and the program logic must be changed."

error 135 - "The data can be refreshed without any delay using the RefreshRates function and make a retry."

 

I don't believe it is the logic since the problem basicly was that the ea was taking frenetical orders (20-30) of the same type instead of just one because I had a loop retrying when the order was not present. the problem would be the ping, not especially one of those errors.

if you really insist that it may be one of these errors Ill take a closer look but I believe this would not be worth the time spent on this troubleshooting as I am already printing where the ea is and how it acts. I have the big picture and it loops the open order as it has no open order in it's list.

btw thank you for answering my posts this is much appreciated.

.