|
6楼
楼主 |
发表于 2012-6-8 15:25:27
|
只看该作者
不能盈利哎
//------------------------------------------------------------------------
// 简称:tradeone
// 名称:tradeone
// 类别: 交易指令
// 类型: 用户应用
//------------------------------------------------------------------------
Params
//参数定义段
Numeric num(1) ;//开平仓手数
Vars
//局部变量定义段
Numeric bb_openprice(0);//多开价格
Numeric bb_outprice(0);//多平价格
Bool bb_openBool(False);//判断是否多开
Bool bb_outBool(False);//判断是否多平
Numeric ss_openprice(0);//空开价格
Numeric ss_outprice(0);//空平价格
Bool ss_openbool(False);//判断是否空开
bool ss_outbool(False);//判断是否空平
Begin
bb_openprice=High[1];
bb_outprice=Low[1];
ss_outprice=High[1];
ss_openprice=Low[1];
//多平
bb_outBool=((MarketPosition==1)&&(CurrentTime>0.1458||Low<low[1]));
if(bb_outBool)
{
Sell(num,bb_outprice);
PlotText(low-2,"多平"+Text(low[1]));
}
//空平
ss_outbool=((MarketPosition==-1)&&(CurrentTime>0.1458||high>High[1]));
If(ss_outbool)
{
BuyToCover(num,ss_outprice);
PlotText(High+2,"空平"+Text(High[1]));
}
//多开
bb_openBool=(Open[1]<Close[1]&&High>High[1]&&CurrentTime<0.1430&&MarketPosition==0&&CurrentTime>0.0916);
if(bb_openBool)
{
Buy(num,bb_openprice);
PlotText(High,"多开"+Text(High[1]));
}
//空开
ss_openbool=(Open[1]>Close[1]&&Low<low[1]&&CurrentTime<0.1430&&MarketPosition==0&&CurrentTime>0.0916);
if(ss_openbool)
{
SellShort(num,ss_openprice);
PlotText(Low,"空开"+Text(low[1]));
}
//初始化交易判断值
bb_outBool=0;
bb_openBool=0;
ss_outbool=0;
ss_openbool=0;
End
|
|