- 精华
- 1
- 在线时间
- 84 小时
- UID
- 714
- 积分
- 581
- 帖子
- 126
- 阅读权限
- 50
- 注册时间
- 2007-11-10
- 最后登录
- 2015-12-1
- 精华
- 1
- UID
- 714
- 积分
- 581
- 帖子
- 126
- 主题
- 23
- 阅读权限
- 50
- 注册时间
- 2007-11-10
- 最后登录
- 2015-12-1
|
我是初学者,有很多东西也要向各位高人讨教,这个问题我不知
但是还是改了一下格式,但愿能够方便高人的阅读:)
//------------------------------------------------------------------------
// 简称: test
// 名称: test
// 类别: 交易指令
// 类型: 多头建仓
// 输出:
//------------------------------------------------------------------------
Params
Numeric nOrders(1);
Numeric nMax(1);
Numeric nLoss(50);
Vars
Bool con1(False);
bool con2(False);
Bool con3(False);
Begin
con1=(CloseD[1]-OpenD[1])>=0;
con2=(CloseD[1]-OpenD[1])<0;
con3=CurrentTime>=0.091000 and CurrentTime<=0.145800;
if(BarStatus==2 and con3)
{
if(con1 and MaxContracts<=nMax)
{
if(MarketPosition==-1)
BuyToCover(nOrders,0);
if(MarketPosition==0)
{
Buy(nOrders,0);
}
}
if (con2 && MaxContracts<=nMax)
{
if(MarketPosition==1)
Sell(nOrders,0);
if(MarketPosition==0)
{
SellShort(nOrders,0);
}
}
if (MarketPosition!=0 and MaxPositionLoss>=nLoss)
{
if(MaxPositionLoss==1)
{
Sell(nOrders,0);
SellShort(nOrders,0);
}
if(MaxPositionLoss==-1)
{
BuyToCover(nOrders,0);
Buy(nOrders,0);
}
}
}
if (CurrentTime>0.145800) //收盘清仓
{
Sell;
BuyToCover;
}
End
//------------------------------------------------------------------------
// 编译版本 GS2004.06.12
// 用户版本 2008/07/15 19:54
// 版权所有 hedgehog
// 更改声明 TradeBlazer Software保留对TradeBlazer平台
// 每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------ |
|