![自动交易和策略测试 自动交易和策略测试](/i/community/logo_mql5_small.png)
自动交易和策略测试
- www.mql5.com
MQL5:MetaTrader 5客户端内置的交易策略语言。语言允许编写您自己的自动交易系统,技术指标,脚本和函数程序库
if(ma1<ene1_dn&&macd<0&&bid<ma2<ene2_dn&&stoploss_s<Maximum_TP*Vpoint) { res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,100,ma2-bid+vspread+L_ma1*Vpoint,0,"",MAGICMA,0,Red); return; }
改进 if(ma1<ene1_dn&&macd<0&&bid<ma2<ene2_dn&&stoploss_s<Maximum_TP*Vpoint)
{
res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,100,ma2-bid+vspread+L_ma1*Vpoint,0,"",MAGICMA,0,Red);
if(res>0)
{
if(OrderSelect(res,SELECT_BY_TICKET,MODE_TRADES))
Print("SELL order opened : ",OrderOpenPrice());
}
else
Print("Error opening SELL order : ",GetLastError());
return;
}
看提示的错误代码,参考 https://docs.mql4.com/cn/constants/errorswarnings/errorcodes