AmiBroker AFL plugins for sending signals/data to external applications via HTTP or TCP.
Author: sggin1/ak47 - Long-time AmiBroker user & supporter
| Plugin | Protocol | Use Case |
|---|---|---|
| HSend | HTTP POST | Web services, REST APIs, Flask/FastAPI/Node.js |
| TSend | Raw TCP | Lightweight receivers, custom scripts, low latency |
Both plugins send to localhost:5000 by default.
// HTTP - sends JSON payload
result = HSend("BUY,AAPL,100");
// TCP - sends pipe-delimited payload
result = TSend("BUY,AAPL,100");
// Returns: 1.0 = success, 0.0 = failure, -1.0 = no argument provided
HSend (JSON):
{"timestamp":"143052.123","chartID":1,"payload":"BUY,AAPL,100"}TSend (Pipe-delimited):
143052.123|1|BUY,AAPL,100
- Download or compile the DLL(s)
- Copy to your AmiBroker
Pluginsfolder (e.g.,C:\Program Files\AmiBroker\Plugins\) - Restart AmiBroker
- Use
HSend()orTSend()in your AFL formulas
- MinGW-w64 (GCC 8.0+): https://www.mingw-w64.org/downloads/
- AmiBroker Development Kit (ADK): https://gitlab.com/amibroker/adk
- Download
Plugin.hfrom the ADK repository - Place it in the same folder as the source files
- Download
# HSend (HTTP version)
g++ -shared -m64 -w -D_USRDLL -o HSend.dll HSend.cpp -lwinhttp
# TSend (TCP version)
g++ -shared -m64 -w -D_USRDLL -o TSend.dll TSend.cpp -lws2_32Build notes:
-D_USRDLLflag required for proper dllexport- Removed unnecessary
#pragma pack(push, 2)from source files (TY msm51)
- OS: Windows 7/8/10/11 (64-bit)
- AmiBroker: Version 6.0+ with plugin support
- Network: Port 5000 available on localhost
- Receiver: Your own HTTP server or TCP listener on port 5000
from flask import Flask, request
app = Flask(__name__)
@app.route('/amibroker_signal', methods=['POST'])
def receive_signal():
data = request.get_json()
print(f"Received: {data}")
return "OK", 200
if __name__ == '__main__':
app.run(port=5000)import socket
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('127.0.0.1', 5000))
server.listen(5)
print("Listening on port 5000...")
while True:
client, addr = server.accept()
data = client.recv(1024).decode()
print(f"Received: {data}")
client.close()This project is provided as-is for the AmiBroker community.
ADK Notice: Building from source requires Plugin.h from the AmiBroker Development Kit, which is Copyright (C) 2001-2019 Tomasz Janeczko, AmiBroker.com and used under their royalty-free license.