- 精华
- 0
- 在线时间
- 151 小时
- UID
- 234032
- 积分
- 155
- 帖子
- 94
- 阅读权限
- 40
- 注册时间
- 2016-5-9
- 最后登录
- 2021-10-26
- 精华
- 0
- UID
- 234032
- 积分
- 155
- 帖子
- 94
- 主题
- 45
- 阅读权限
- 40
- 注册时间
- 2016-5-9
- 最后登录
- 2021-10-26
|
发表于 2019-12-2 09:38:56
|显示全部楼层
Bool BuyCondition(false);
Begin//公式主体部分
//变量计算部分
//此处添加代码正文
If(!CallAuctionFilter()) Return; // 对集合竞价和小结开始的行情进行过滤,防止无效的发单操作。
LowerBand= LowestFC(Low,Length);
DonchianHi = LowerBand+kaicang;
//写出数据
PlotNumeric("DonchianHi",DonchianHi,0,Red);
PlotNumeric("LowerBand",LowerBand);
BuyCondition =CrossOver(High,DonchianHi);
//开仓部分
If(MarketPosition==0 and BuyCondition==True)
{
buy(lots,Max(open,DonchianHi ));
}
Commentary("EntryPrice="+Text(EntryPrice));
If(MarketPosition == 1 and BarsSinceEntry>=1)
{
If(Low<= EntryPrice-TrailingStop)
{
MyExitPrice = EntryPrice-TrailingStop;
If(Open < MyExitPrice) MyExitPrice = Open;
Sell(0,MyExitPrice);
}
If(High >= EntryPrice+ zhiying)
{
Sell(0,EntryPrice+ zhiying);
}
}
这样的写法有问题吗,比如苹果,为什么开盘第一根K线开仓的时候,图表信号已经开仓了,但是委托和成交记录都没有信息,视图选项的消息中心有没有信息,请问老师是为什么 |
|