|
本帖最后由 frlin2003 于 2016-6-2 13:53 编辑
- #property copyright "frlin2003"
- #property link "http://my.fx3q.com"
- input double 浮盈=300; //黄金两位数300 三位数30? 五位数货币0.3?需测试验证。
- input double 止盈=1000;
- int start()
- {
- int cnt,total;
- bool res;
- double stop, profitt;
- total=OrdersTotal();
- for(cnt=0;cnt<total;cnt++)
- {
- if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
- continue;
- if(OrderType()==OP_BUY && Bid-OrderOpenPrice()>Point*浮盈 && Bid-OrderOpenPrice()<Point*止盈) stop=OrderOpenPrice(); profitt=OrderOpenPrice()+Point*止盈; //开仓设置100点止盈。
- if(OrderType()==OP_BUY && Bid-OrderOpenPrice()<Point*浮盈) stop=0;profitt=OrderOpenPrice()+Point*止盈;
- if(OrderType()==OP_SELL && (OrderOpenPrice()-Ask)>Point*浮盈 && (OrderOpenPrice()-Ask)<Point*止盈) stop=OrderOpenPrice();profitt=OrderOpenPrice()-Point*止盈;
- if(OrderType()==OP_SELL && (OrderOpenPrice()-Ask)<Point*浮盈) stop=0;profitt=OrderOpenPrice()-Point*止盈;
- res=OrderModify(OrderTicket(),OrderOpenPrice(),stop,profitt,0,Red);
- }/*
- return(0);
- }
复制代码
快靠近完整版。。。感觉上。 |
|