#property copyright
#property link
#include <stdlib.mqh>
#include <WinUser32.mqh>
int start()
{
int ticket,expiration;
double point,bid,ask;
//----
point=MarketInfo(Symbol(),MODE_POINT);
expiration=TimeCurrent( )+PERIOD_D1*60 - (Hour( ) +1)*60;
if(MessageBox("编写 ",
//----
bid=Bid;
ask=Ask;
for(int i1=10;i1>0;i1--)
{
bid-=30*point;
ask+=30*point;
ticket=OrderSend(Symbol(),OP_BUYSTOP,0.01,ask,3,0,ask+30*Point,"EA编写:",20090202,expiration,Blue);
ticket=OrderSend(Symbol(),OP_SELLSTOP,0.01,bid,3,0,bid-30*Point,"EA编写:",20090202,expiration,Red);
ticket=OrderSend(Symbol(),OP_BUYLIMIT,0.01,Ask-30*Point,3,0,Bid+30*Point,"EA编写:",20090202,expiration,Yellow);
ticket=OrderSend(Symbol(),OP_SELLLIMIT,0.01,Bid+30*Point,3,0,Ask-30*Point,"EA编写:",20090202,expiration,Green);
if(ticket<1)
{
int error=GetLastError();
Print("Error = ",ErrorDescription(error));
return;
}
//----
OrderPrint();
}
Alert("编写");
return(0);
}
//+------------------------------------------------------------------+
各位大神好。我想弄一个网格的脚本,把四种挂单方式都挂上去。然后呢,我的OP_BUYSTOP,OP_SELLSTOP这两种挂单都能挂上,并且按我设定的10次,依次上下排成网格。但是OP_BUYLIMIT,OP_SELLLIMIT就不行,虽然设成了10次,但是它们只在刚下单的地方下10次单,就成重复下10次单,没有上下形成网格。救大神教教我。谢谢
|