Execute Order using an external program (c++)

 

Hi everyone,

I really search the internet for hours but I do not find an answer to my question.

Let us assume there are two terminals:

Terminal A: terminal with broker X

Terminal B: terminal with broker Y

With respect to the quotes from Terminal A and B, I want to execute orders in Terminal A and B simultaneously. Now I have the problem that I need both quotes from both terminals to make the decision placing the order.

I figured out three possibilities:

1. Send the quotes to an external program and then make the program execute the orders at Terminal A and Terminal B. The problem with this is that I have not found a way yet to place an order from an external program because only an EA can place the order. Or is there a possible solution?

2. Exchange quotes between the two terminals using for example an DLL but then I have the problem that I make the decision in either Terminal A or B. So now for example Terminal A has to send a notice to Terminal B to place an order. But this is also not possible right?

3. Exchange quotes between the two terminals using for example an DLL. When Terminal A decide to place orders, send a notice via an DLL to Terminal B. Unfortunately, this is not possible directly but I could wait till the next tick and then the EA, which would read the notice via DLL, would be executed at Terminal B and then Terminal B would also place the order.

Actually number 3 is the only possiblilty in my understanding or am I wrong?

The problem with number however is that the order at the other terminal is not executed until a new tick arrives at the other terminal. This is actually bad. Does somebody has an idea how to compensate that?

I am looking for APIs for hours but do not find any useful ones. The APIs that I found always only require an EA and there it is also the problem that the order in the terminals are executed not before an tick occurs and an EA is executed. Or do they work different?

I thank you very much in advance.

Best regards,

Frederic

 

It is not so bad. You can communicate between EAs. And EAs can trade. You only need to wake up the counterpart EA to fetch a new message (with quote or with a command to place an order). To do so, the EAs must exchange their window handles, so the counterpart is capable to remotely trigger start() of the other EA any time.

Reason: