8. Plugin Specification
8.1 Plugin summary
FXDaemon loads the plugin via libPluginProxy, and connects to the broker server with the following configuration.
FXDaemon ⇔ libPluginProxy ⇔ Plugin ⇔ Broker
The plugin should implement the IBaseOrder interface to be called by FXDaemon.
When a specific event occurs, the plugin can notify FXDaemon via the IPluginProxy interface.
8.2 Interface implemented by the plugin - IBaseOrder -
Read the INI file to initialize the plugin.
[Returns]
[Parameters]
iniFile | :initialization file |
Log in to the broker server.
[Returns]
Log out the broker server and close the plugin.
[Returns]
Get broker server time.
[Returns]
Get account information.
[Returns]
[Parameters]
accountID | :account number |
tblAccount | :acquired account information |
Get market data.
[Returns]
[Parameters]
symbols | :symbol list |
pTblPrice | :acquired market data |
Get opened positions.
[Returns]
Number of opened position |
[Parameters]
pTblTrade | :acquired opened position |
Get closed positions this week.
[Returns]
Number of closed position |
[Parameters]
pTblTrade | :acquired closed position |
Get historical data.
[Returns]
Number of historical data |
[Parameters]
symbol | :symbol |
period | :period(m5, m15, m30, H1, H4, D1) |
start | :start time |
end | :end time |
maxRange | :whether to obtain the maximum range flag |
pTblCandle | :acquired historical data |
Open position at market price.
[Returns]
[Parameters]
tblOrder | :order information |
If successful, you need to set the order number in the order information.
Change stop loss.
[Returns]
[Parameters]
tblOrder | :order information |
If successful, you need to set the order number in the order information.
Change take profit.
[Returns]
[Parameters]
tblOrder | :order information |
If successful, you need to set the order number in the order information
Close an opened position.
[Returns]
[Parameters]
tblOrder | :order information |
8.3 Interface used from plugin - IPluginProxy -
Register the plugin.
[Returns]
[Parameters]
name | :plugin name |
baseOrder | :plugin instance |
Send an event when disconnected from the broker server.
Output the log.
[Parameters]
level | :output level |
message | :log message |
Send an event when the market data is changed.
[Parameters]
status | :status |
tblPrice | :market data |
Send an event when the account information is changed.
[Parameters]
status | :status |
tblAccount | :account information |
Send an order event.
[Parameters]
status | :status |
tblOrder | :order information |
Send an event when the opened position is changed.
[Parameters]
status | :status |
tblTrade | :opened position information |
Send an event when the closed position is changed.
[Parameters]
status | :status |
tblTrade | :closed position information |