指标可自行修改成交价位、单子数量、相隔距离及赢损设置,谨慎重仓之首选
粗糙式代码:
- //-------------------------------sell limit.mq4
- extern double JG=0;
- extern double ZY=500;
- extern double ZS=200;
- int start()
- {
- double DJ=JG-1;
- double lot=0.1;
- double dpoint=Point*MathPow(10,Digits%2);
- double OpenPos=Ask;
- double OpenPos1=Ask+(DJ-3)*dpoint;
- double OpenPos2=Ask+(DJ-6)*dpoint;
- double OpenPos3=Ask+(DJ-9)*dpoint;
- double OpenPos4=Ask+(DJ-12)*dpoint;
- double OpenPos5=Ask+(DJ-15)*dpoint;
- double OpenPos6=Ask+(DJ-18)*dpoint;
- double OpenPos7=Ask+(DJ-21)*dpoint;
- double OpenPos8=Ask+(DJ-24)*dpoint;
- double OpenPos9=Ask+(DJ-27)*dpoint;
- double OpenPos10=Ask+(DJ-30)*dpoint;
- double OpenPos11=Ask+(DJ-33)*dpoint;
- double OpenPos12=Ask+(DJ-36)*dpoint;
- double OpenPos13=Ask+(DJ-39)*dpoint;
- double OpenPos14=Ask+(DJ-42)*dpoint;
- double OpenPos15=Ask+(DJ-45)*dpoint;
- double OpenTP=Ask-ZY*dpoint;
- double OpenSL=Ask+ZS*dpoint;
-
- int ticket=OrderSend(Symbol(),5,lot,OpenPos,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket1=OrderSend(Symbol(),5,lot,OpenPos1,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket2=OrderSend(Symbol(),5,lot,OpenPos2,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket3=OrderSend(Symbol(),5,lot,OpenPos3,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket4=OrderSend(Symbol(),5,lot,OpenPos4,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket5=OrderSend(Symbol(),5,lot,OpenPos5,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket6=OrderSend(Symbol(),5,lot,OpenPos6,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket7=OrderSend(Symbol(),5,lot,OpenPos7,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket8=OrderSend(Symbol(),5,lot,OpenPos8,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket9=OrderSend(Symbol(),5,lot,OpenPos9,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket10=OrderSend(Symbol(),5,lot,OpenPos10,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket11=OrderSend(Symbol(),5,lot,OpenPos11,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket12=OrderSend(Symbol(),5,lot,OpenPos12,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket13=OrderSend(Symbol(),5,lot,OpenPos13,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket14=OrderSend(Symbol(),5,lot,OpenPos14,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
- int ticket15=OrderSend(Symbol(),5,lot,OpenPos15,3,OpenSL,OpenTP,"Sell",1234,0,Lime);
-
- if(ticket<0)
- {
- Print("OrderSend 失败错误 #",GetLastError());
- return(0);
- }
- return(0);
- }
复制代码
|