Forward Buy/Sell over local network through sockets


I have the task of sending Buy/Sell signals generated from existing afl code to another system on LAN for further processing.
The target system will receive the data into managed code.
I was planning to develop a plugin so that it can be used in the afl code.
I just wanted to confirm if developing a plugin would be the best course of action?
Or if there is another better way to achieve this?


1 Like

You can also implement simple HTTP server on the receiving end and use InternetOpenURL function to send GET requests. That would save the work of creating the plugin at all.

1 Like

So, in this way can we do algo trades.

I mean is it similar to algo trading i.e placing orders automatically on the trading terminal (either web based or exe based) as per the signals generated in the afl----with out any manual intervention?

Thanks for the prompt reply.

Actually the application running on the other system is a Desktop App and requirements specifications state the protocol must be TCP/IP, zero tolerance on performance.

So I gather it can be done through a plugin, if one doesn't mind putting in the work, right?

I was just a bit curious about what limitations, if any, does Amibroker put on the plugin code or I can do absolutely wataever that a C++ DLL is capable of ?

Yes, that is what we are aiming for.

Can I get any sample code or till developed code by you---so that I can learn further?

I am also interested in the same .But as a newbie and being a non-tech guyI do not have any clue how and from where to start.

Hope , you will help me.

Ready to help, but sample code of what..? And if you are a non tech guy, what good is it gonna do..?

For start learn a programming language, If you are gonna do it for Amibroker..C/C++ is the best option!

1 Like

already started learning c.

At present able to play around with afls to amend/modify as per my idea.

want any simple algo afl code to start paying around with.

You can get a lot of stuff online, for playing around with I mean.

Have you tried that!

I searched , but not got yet!!!

Any link you can refer---would be a start for me.

Additionally, can you tell me what are the things required (except ami, afl & trading terminal---of course) for algo trading by afl?

Does not matter at all. Desktop app can have HTTP server inside, no problem with that. HTTP server IS using TCP/IP and really everything I wrote previously holds up. From your posts I can see (near) zero knowledge about network programming so I really advise you hire someone who is knowledgeable.

I knew that already.

Anyways, appreciate the response and the advise. My best for the future of Amibroker!:+1:

It works like this :

  1. Amibroker sends the signal to your "Bridge Application". (AFL Function)
  2. It then prepares your order on the basis of the data recieved. (Bridge App)
  3. The order is placed on Trading Terminal through the API provided by your Broker. (Broker API)

So, Please confirm if my below understanding is correct:

(AFL Function) & (Bridge App)----we have to write the code in afl.

(Broker API)---we have to subscribe it from the broker by paying the fees.

Yeah..pretty much!
I will explain this one point further though..

The AFL Function could be your own(plugin) or an in-built one(like Tomasz suggested), depending on your needs you may or may not need the Bridge App. If you don't, you can directly use the Broker API from Ami plugin to trade. But if you do, this app will receive the signal from Amibroker and place the order using the API.