int start()
{
int ticket3;
int ticket4;
double toucun=0.6;//头寸
double jiacang=0.1;//加仓手数
double juli=150;//挂单距离当前价距离.五位数平台使用150.四位数平台使用15
double zhisun=150;//止损是统一止损
double zhiying=750;//止盈,统一止盈
double jiange=20;//加仓的单子,之间的间隔
int ticket1=OrderSend(Symbol(),5,toucun,Ask-Point*juli,0,Ask+Point*zhisun,Ask-Point*zhiying,"",0,CLR_NONE);
int ticket2=OrderSend(Symbol(),4,toucun,Bid+Point*juli,0,Bid-Point*zhisun,Bid+Point*zhiying,"",0,CLR_NONE);
for (int j=1; j<=20; j++) ticket3=OrderSend(Symbol(),5,jiacang,Ask-Point*juli-j*Point*jiange,0,Ask+Point*zhisun,Ask-Point*zhiying,"",0,CLR_NONE);
for (int i=1; i<=20; i++) ticket4=OrderSend(Symbol(),4,jiacang,Bid+Point*juli+i*Point*jiange,0,Bid-Point*zhisun,Bid+Point*zhiying,"",0,CLR_NONE);
return(0);
}
数据行情双向突破挂单的脚本.mq4
(1.56 KB, 下载次数: 20)
//备注:要开启允许自动交易
//备注:挂单的数量,加起来的距离,要小于止损和止盈的距离,否则冒头了
// for (int j=1; j<=20; j++) 其中的20=20个单子。可修改。 |