Hook EA
- 实用工具
- Ping You Jiang
- 版本: 1.0
- 激活: 5
您是否想过将您用的EA交易信号分享给朋友?或者您的EA信号本来可以交易加密货币,但却不能直接在MT5中进行币安合约交易?或者您拥有了一个优秀的EA,但没有源代码无法应用到其他量化交易平台上?Hook EA就是为了解决这些问题。不管您是用真实账户还是Demo账户交易,Hook EA可以实时监控任何EA提交的Order或者Deal,并将这些信息以JSON方式发送到指定的地址(注意:接收信息的地址需要添加到WebReqeust中),并且,如果接收失败,系统内置了重试机制,可以自定义在多少时间之内重新提交。另外,Hook EA还提供多种订单过滤规则,包括Symbol,Magic Number,Comment等。最后,Hook EA也提供了日志窗口,便于查看订单广播情况。
参数:
Enable order data:是否提交Order信息,包括ADD,UPDATE,DELETE
Enable deal data:是否提交Deal信息,包括ADD,UPDATE,DELETE
Filter by Symbol:根据Symbol过滤信息,为空不过滤Symbol
Filter by Magic number:根据Magic Number过滤信息,为空不过滤Magic Number
Filter by Comment:根据Comment过滤信息,为空不过滤Comment
Post URL:接收提交信息的URL地址(如http://www.example.com/ea.php,支持https,注意,需要将对应地址www.example.com加入到Tools-Expert Advisors-Allow WebRequest for listed URL),接收成功后需要返回成功信息
Server receives the confirmation return string:成功接收信息返回字符串(如ok),否则工具会重试直到结束
The number of retries when commit fails:无法获取接收成功信息时,最大重试次数
retry interval:重试间隔(单位:秒)
Enable log window:是否启用窗口显示日志
Time zone offset:相对于经纪商的时区(便于查看日志)
格式:Json
Order示例:字段参考:MQL5 Reference / Constants, Enumerations and Structures / Trade Constants / Order Properties
{
"TYPE": "TRADE_TRANSACTION_ORDER_ADD",
"ORDER_TICKET": 1538679204,
"ORDER_TIME_SETUP": 1670575184,
"ORDER_TYPE": "ORDER_TYPE_BUY",
"ORDER_STATE": "ORDER_STATE_STARTED",
"ORDER_TIME_EXPIRATION": 0,
"ORDER_TIME_DONE": 0,
"ORDER_TIME_SETUP_MSC": 1670575184296,
"ORDER_TIME_DONE_MSC": 0,
"ORDER_TYPE_FILLING": "ORDER_FILLING_FOK",
"ORDER_TYPE_TIME": "ORDER_TIME_GTC",
"ORDER_MAGIC": 123456,
"ORDER_REASON": "ORDER_REASON_EXPERT",
"ORDER_POSITION_ID": 0,
"ORDER_POSITION_BY_ID": 0,
"ORDER_VOLUME_INITIAL": 0.01,
"ORDER_VOLUME_CURRENT": 0.01,
"ORDER_PRICE_OPEN": 1.05771,
"ORDER_SL": 0,
"ORDER_TP": 0,
"ORDER_PRICE_CURRENT": 1.05771,
"ORDER_PRICE_STOPLIMIT": 0,
"ORDER_SYMBOL": "EURUSD",
"ORDER_COMMENT": null
}
Deal示例:字段参考:MQL5 Reference / Constants, Enumerations and Structures / Trade Constants / Deal Properties
{
"TYPE": "TRADE_TRANSACTION_DEAL_ADD",
"DEAL_TICKET": 1516120626,
"DEAL_ORDER": 1538679204,
"DEAL_TIME": 1670575184,
"DEAL_DEAL_TIME_MSCTICKET": 1670575184296,
"DEAL_TYPE": "DEAL_TYPE_BUY",
"DEAL_ENTRY": "DEAL_ENTRY_IN",
"DEAL_MAGIC": 123456,
"DEAL_REASON": "DEAL_REASON_EXPERT",
"DEAL_POSITION_ID": 1538679204,
"DEAL_VOLUME": 0.01,
"DEAL_PRICE": 1.05771,
"DEAL_COMMISSION": 0,
"DEAL_SWAP": 0,
"DEAL_PROFIT": 0,
"DEAL_FEE": 0,
"DEAL_SL": 0,
"DEAL_TP": 0,
"DEAL_SYMBOL": "EURUSD",
"DEAL_COMMENT": null
}
接收端ea.php:(其他语言类似)
<?php
$fp = fopen("/tmp/ea.txt", "a+");
if($fp){
fputs($fp, file_get_contents('php://input'));
fclose($fp);
echo "ok";
}
?>