How to load same dll two instance

Hello !!!

I want to use the same program to send an order instruction to two accounts, but my broker’s api requires two api instances to place orders at the same time. May I ask amibroker to load dll to 2 instances in the same amiboker program.

Thank you very much, any suggestions are fine.

Unfortunately your question isn't clear enough and does not provide all necessary details to give you an answer. Please follow this advice: How to ask a good question

I don't know what broker API you use and what plugin architecture, but general answer is that one plugin is loaded once. If you wanted it twice then depending on plugin architecture (is it AFL plugin or OLE) you could copy the file with another name.

1 Like

First of all, thank you Tomasz for the tip,

I restate my problem and the current system architecture:

  1. The api of my local broker is of dll type, and I wrote the order interface using afl plugin.

  2. So my ordering program is

Login( account, password);

Order( account, Buy, ...);

  1. Now I want to place two accounts at the same time in one afl
Login( account, password);
Login( account1, password1);

Order( account, Buy, ... );
Order( account1, Buy, ...);
  1. However, my local broker’s api is restricted, so I can’t login to two accounts at the same time, and I must use two dll instances

So what I do now is to write two afl plugins and separate the function name

Such as

Login( account, password);
Login1( account1, password1);

Order( account, Buy, ... );
Order1( account1, Buy, ... );

Is there a better way to suggest

Thank you, all responses are appreciated

In that case (if broker does not allow to connect from one DLL and if it is YOUR plugin so you have the source code), you can create two copies of your plugin that would be identical internally but just different function names. This can be easily done just by changing FunctionTable entries in your source. Actual code would remain the same.