您需要 登录 才可以下载或查看,没有帐号?注册
#property copyright lf
#property link extern int MA1 = 3;
extern int MA2 = 21;
extern int i;
extern int Ti;int init()
{
i=0;
return;
}int start()
{
if (iMA(NULL,0,MA1,0,3,5,0) iMA(NULL,0,MA2,0,3,5,0)) open_sell();
if (iMA(NULL,0,MA1,0,3,5,0) iMA(NULL,0,MA2,0,3,5,0)) open_buy();
return;
}
int open_sell()
{
if (OrdersTotal()==0) OrderSend(Symbol(),1,0.01,Bid,3,0,0, ,0,0,Yellow);
if (OrdersTotal()!=0)
for (i=1;i==OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
Ti=OrderTicket();
if (OrderType()==OP_BUY) OrderClose(Ti,OrderLots(),Bid,3,Red);
// OrderSend(Symbol(),1,0.01,Bid,3,0,0, ,0,0,Yellow);
}
return;
}
int open_buy()
{
if (OrdersTotal()==0) OrderSend(Symbol(),0,0.01,Ask,3,0,0, ,0,0,Blue);
if (OrdersTotal()!=0)
for (i=1;i==OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
Ti=OrderTicket();
if (OrderType()==OP_SELL) OrderClose(Ti,OrderLots(),Ask,3,Green);
// OrderSend(Symbol(),0,0.01,Ask,3,0,0, ,0,0,Blue);
}
return;
}
//+------------------------------------------------------------------+
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!