下载MetaTrader 5
要添加评论,请登录注册
您开发盈利策略了吗?通过信号与数百万交易者分享它!
黄中华
10
黄中华 2012.01.13 16:34 

//+------------------------------------------------------------------+
//| 尝试.mq4 |
//| Copyright ?2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
extern double lots=0.01;
extern double StopLoss=30;


int start()
{int n1,n2,m1,m2,total,orderstotal;
if(Bars<100 //如果历史数据不足100根K线
|| IsTradeAllowed()==false) // 或者系统目前不允许交易
return; // 退出
total=OrdersTotal();
if(total<1)
int Magic,Slippage;

n1=iCustom(NULL,0,"mymacd",62,92,10,0,0);
n2=iCustom(NULL,0,"mymacd",62,92,10,1,0);
m1=iCustom(NULL,0,"mymacd",62,92,10,0,1);
m2=iCustom(NULL,0,"mymacd",62,92,10,1,1);
if(n1>n2&&m1<m2)

{ OrderSend (Symbol(), OP_BUY,0.01, Ask, Slippage,StopLoss,0,Magic,0, Blue);
if(n1<n2&&m1>m2)
OrderClose (OrderTicket(),OrderLots(),Ask,Slippage,Red);
return(0);
}

if(n1<n2&&m1>m2)
{OrderSend (Symbol(), OP_SELL,0.01, Bid,Slippage,StopLoss,0,Magic,0, Red);
if(n1>n2&&m1<m2)
OrderClose ( OrderTicket(),OrderLots(),Bid,Slippage,Blue);}

return(0);
}
一测试什么都没任何反应,请教下哪位能指点迷津不,谢谢啦

yuan33595956
3
yuan33595956 2012.01.14 10:43  
wtfasaz:

//+------------------------------------------------------------------+
//| 尝试.mq4 |
//| Copyright ?2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
extern double lots=0.01;
extern double StopLoss=30;


int start()
{int n1,n2,m1,m2,total,orderstotal;
if(Bars<100 //如果历史数据不足100根K线
|| IsTradeAllowed()==false) // 或者系统目前不允许交易
return; // 退出
total=OrdersTotal();
if(total<1)
int Magic,Slippage;

n1=iCustom(NULL,0,"mymacd",62,92,10,0,0);
n2=iCustom(NULL,0,"mymacd",62,92,10,1,0);
m1=iCustom(NULL,0,"mymacd",62,92,10,0,1);
m2=iCustom(NULL,0,"mymacd",62,92,10,1,1);
if(n1>n2&&m1<m2)

{ OrderSend (Symbol(), OP_BUY,0.01, Ask, Slippage,StopLoss,0,Magic,0, Blue);
if(n1<n2&&m1>m2)
OrderClose (OrderTicket(),OrderLots(),Ask,Slippage,Red);
return(0);
}

if(n1<n2&&m1>m2)
{OrderSend (Symbol(), OP_SELL,0.01, Bid,Slippage,StopLoss,0,Magic,0, Red);
if(n1>n2&&m1<m2)
OrderClose ( OrderTicket(),OrderLots(),Bid,Slippage,Blue);}

return(0);
}
一测试什么都没任何反应,请教下哪位能指点迷津不,谢谢啦


你的止损止盈设置有问题,比如buy,止损应该是ask-stoploss*point。
黄中华
10
黄中华 2012.01.15 02:44  
380273421:

你的止损止盈设置有问题,比如buy,止损应该是ask-stoploss*point。

哦,非常感谢啊,我出去有点事,等下来慢慢看
黄中华
10
黄中华 2012.01.15 17:38  

extern double lots=0.01;
extern double StopLoss=30;


int start()
{ double n1,n2;
int total,Magic,Slippage;
total=OrdersTotal();
n1=iCustom(NULL,0,"macdpwang",62,92,10,3,0);
n2=iCustom(NULL,0,"macdpwang",62,92,10,3,1);
if(total<1)
{
if(n1>0&&n2<0){ OrderSend (Symbol(), OP_BUY,lots, Ask-StopLoss*Point, 3,StopLoss,0, Blue);}
if(n1<0&&n2>0){ OrderSend (Symbol(), OP_SELL,lots, Bid+StopLoss*Point, 3,StopLoss,0, Red);}
return(0);
}
if(total>1)
{
if(OrderType()==OP_BUY&&(n1<0)){OrderClose (OrderTicket(),OrderLots(),Bid,3,Blue);}
if(OrderType()==OP_SELL&&(n1>0)){OrderClose (OrderTicket(),OrderLots(),Ask,3,Red);}

return(0);
}

return(0);
}
我改了一下,有些变动,结果还是无反应

JUN HU
209
JUN HU 2012.03.20 13:09  

if(n1>0&&n2<0){ OrderSend (Symbol(), OP_BUY,lots, Ask-StopLoss*Point, 3,StopLoss,0, Blue);}
if(n1<0&&n2>0){ OrderSend (Symbol(), OP_SELL,lots, Bid+StopLoss*Point, 3,StopLoss,0, Red);}
改成:
if(n1>0&&n2<0){ OrderSend (Symbol(), Ask,lots, Ask-StopLoss*Point, 3,StopLoss,0, Blue);}
if(n1<0&&n2>0){ OrderSend (Symbol(), Bid,lots, Bid+StopLoss*Point, 3,StopLoss,0, Red);}
如果还不行,可以联系QQ:249974322

/
要添加评论,请登录注册