English
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 -
..initloginclosegetServerTime
getAccountgetPricegetOpenedTradesgetClosedTradesgetHistoricalData
openMarketOrderchangeStopLosschangeTakeProfitcloseTrade

Read the INI file to initialize the plugin.

[Returns]

success:0
failed:-1

[Parameters]

iniFile:initialization file

Log in to the broker server.

[Returns]

success:0
failed:-1

Log out the broker server and close the plugin.

[Returns]

success:0
failed:-1

Get broker server time.

[Returns]

server time

Get account information.

[Returns]

success:1
failed:0

[Parameters]

accountID:account number
tblAccount:acquired account information

Get market data.

[Returns]

Number of symbol

[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]

success:0
failed:-1

[Parameters]

tblOrder:order information
If successful, you need to set the order number in the order information.

Change stop loss.

[Returns]

success:0
failed:-1

[Parameters]

tblOrder:order information
If successful, you need to set the order number in the order information.

Change take profit.

[Returns]

success:0
failed:-1

[Parameters]

tblOrder:order information
If successful, you need to set the order number in the order information

Close an opened position.

[Returns]

success:0
failed:-1

[Parameters]

tblOrder:order information
8.3 Interface used from plugin - IPluginProxy -
..registerPluginonDisconnectedonMessageonPrice
onAccountonOrderonOpenedTradeonClosedTrade

Register the plugin.

[Returns]

success:true
failed:false

[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