Specification
Hi guys,
I would like to ask for the development of an Expert Advisor (EA).
The development job requested intends to create an EA able to receive POST incoming webhooks and to trigger adequate orders and actions (execute orders (long, short as market, limit), get open orders, ask best order price (ask, bid), adjust order prices, get current positions, get collateral.
If not too complex a simple check for a passphrase shall be performed to reject any fraud webhook messages.
Any instrument tool must be supported (either cryptos, indices, forex, commodities, etc.). The integration should be direct (EA able to receive and execute incoming webhooks). No further software or hosted solutions should be used.
Following there is a proposal for the format of the orders. The format of the webhooks can be adapted, in case it would simplify the development:
Execute order – Prio 1
Request:
{ "passphrase": e.g. "abcd1234",
"action": "execute_order",
"symbol": e.g. "BTCUSD",
“direction": "long" or “short”,
“order_type": "market" or “limit”,
“direction": "long" or “short”,
"stop_loss": e.g. “49000” (not used if “0”),
“take_profit”: e.g. “54000” (not used if “0”),,
“limit_price": e.g. "50000”, (for order type “limit”)
“volume": e.g. "0.5” }
Response:
A success message or error code shall be provided as webhook response after order execution.
{ "code": "success",
"message": "order executed" }
Get collateral – Prio 1
Request:
{ "passphrase": e.g. "abcd1234",
"action": "get_collateral” }
Response:
A message as webhook with following key information:
{ "code": "success",
"equity": e.g. "10000.50",
"margin": e.g. "8000.50",
"free margin": e.g. "2000.00" }
-----------------------------------------------------------------------------------------------------
Get positions – Prio 2
Request:
{ "passphrase": e.g. "abcd1234",
"action": "get_positions” }
Response:
A message as webhook with a list of key information per position:
{ Position 1 {
"order_ID": "55711111",
"type”: “long”, “short”),
“size”: e.g. “0.1”,
"symbol": e.g. "BTCUSD",
“entry_price": e.g. "50000”,
"stop_loss": e.g. “49000”,
“take_profit”: e.g. “54000”,
"actual_price": e.g. "58000.50",
"profit": e.g. "240.50" },
Position 2 {
"order_ID": "55711112",
"type”: “long”, “short”),
“size”: e.g. “1.0”,
"symbol": e.g. "EURUSD",
… }
}
Get open orders – Prio 2
Request:
{ "passphrase": e.g. "abcd1234",
"action": "get_open_orders” }
Response:
A message as webhook with a list of key information per open order:
{ Position 1 {
"order_ID": "55711111",
"type”: “long”, “short”),
“original_size”: e.g. “0.1”,
“remaining_size”: e.g. “0.02”,
"symbol": e.g. "BTCUSD",
“order_price": e.g. "50000”,
"stop_loss": e.g. “49000”,
“take_profit”: e.g. “54000”,
"actual_price": e.g. "58000.50"},
Position 2 {
"order_ID": "55711112",
"type”: “long”, “short”),
“size”: e.g. “1.0”,
"symbol": e.g. "EURUSD",
… }
}
Get best bid ask price – Prio 2
Request:
{ "passphrase": e.g. "abcd1234",
"action": " get_best_order_price” ,
"symbol": e.g. "BTCUSD",}
Response:
A message as webhook with following key information:
{ “best_bid_price": e.g. "50800”,
“best_ask_price": e.g. "50950”,
"actual_price": e.g. "51000.50" }
Cancel order – Prio 2
Request:
{ "passphrase": e.g. "abcd1234",
"action": "cancel_order",
"order_ID": e.g. "55711111"}
Response:
A success message or error code shall be provided as webhook response after order execution.
{ "code": "success",
"message": "order executed" }
Adjust order price – Prio 3
Order to adjust order price and/or volume for a specific existing order without canceling it.
I grouped the orders into 3 priority classes according to their importance. Prio 1 is mandatory, others are optional.
Code should be MQL4 technically feasible. MQL source code will need to be provided and execution not limited to an account/ID.
Detailed webhook syntax needs to be documented and provided.
Don't hesitate to comment/query extra information, if needed.
Cheers,
Schmittie