rqr888666
发表于 2015-6-6 05:43:23
11111111111
993101067
发表于 2015-6-6 07:29:50
baiqiao
发表于 2015-6-6 09:49:05
灵感还有指标?
lin2376
发表于 2015-6-7 09:17:36
好东西,大家分享!就是贵了点!
chantsangsing
发表于 2015-6-7 09:28:16
又来搞神秘。。。
wwauto
发表于 2015-6-7 16:43:49
if (GetbuyLots()>GetsellLots()) lock(OP_SELL);
if (GetbuyLots()<GetsellLots()) lock(OP_BUY);
}
//--------------------------------------------------------------------------*/
return (0);
}
//+--------------------------------锁仓程序------------------------------+
void lock(int Ordertype) {
double Price1,Lot1,Price2,Lot2;
if (Ordertype == OP_BUY) {
OrderSend(Symbol(), OP_BUY, GetsellLots()-GetbuyLots(), Ask, 3, 0, 0, 0, 0, 0, BlueViolet);
locked = TRUE;
}
if (Ordertype == OP_SELL) {
OrderSend(Symbol(), OP_SELL, GetbuyLots()-GetsellLots(), Bid, 3, 0, 0, 0, 0, 0, BlueViolet);
locked = TRUE;
}
return (0);
}
//+------------------------------------------------------------------+/
//+-------------------------计算开单数-------------------------------+
int GetOrdersTotal(int intOrderType)
{
int buy=0,sell=0,total=0;
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;
if(OrderSymbol()!=Symbol()) continue;
//---- check order type
if(OrderType()==OP_BUY ) {buy++;}
if(OrderType()==OP_SELL) {sell++;}
total++;
}
if (intOrderType==OP_BUY)return(buy);
if (intOrderType==OP_SELL) return(sell);
if (intOrderType==6) return(total);
return(99999);
}
//+------------------------------------------------------------------+
//+-------------------------计算buy下单量---------------------------+
double GetbuyLots()
{
datetime lasttime=Time;
double buylots,selllots;
for(inti=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;
if(OrderSymbol()!=Symbol()) continue;
if(OrderType()==OP_BUY)
{
buylots=OrderLots()+buylots;
}
}
return(buylots);
}
//+------------------------------------------------------------------+
//+-------------------------计算sell下单量---------------------------+
double GetsellLots()
{
datetime lasttime=Time;
double selllots;
for(inti=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) continue;
if(OrderSymbol()!=Symbol()) continue;
if(OrderType()==OP_SELL)
{
selllots=OrderLots()+selllots;
}
}
return(selllots);
}
//+--------------------------------------------------------------
wwauto
发表于 2015-6-7 16:44:12
貼錯了,sorry
我是小凤仙
发表于 2015-6-8 12:36:51
o ??????????????????????????????
kzus2
发表于 2015-6-8 12:40:42
我也来看看
好啊好
发表于 2015-6-8 18:29:56
看看谢谢分享
页:
1
2
3
4
5
[6]
7
8
9
10
11
12
13
14
15