- 精华
- 0
- 在线时间
- 74 小时
- UID
- 131542
- 积分
- 13
- 帖子
- 7
- 阅读权限
- 10
- 注册时间
- 2013-6-11
- 最后登录
- 2022-5-18
- 精华
- 0
- UID
- 131542
- 积分
- 13
- 帖子
- 7
- 主题
- 1
- 阅读权限
- 10
- 注册时间
- 2013-6-11
- 最后登录
- 2022-5-18
|
另外 这个是啥情况 有大佬讲讲吗
照葫芦画瓢整出来的代码
timeready = (time>=0.21 && time<=0.2359)Or(time>=0.09 && time<0.1459); //夜盘经常时间判定
PlotNumeric ("HiBand",HiBand);
PlotNumeric ("LoBand",Loband);
Commentary("多单进场"+Text(HiBand));
Commentary("空单进场"+Text(LoBand)); // 输出数据
//判断是否入场做多
If(timeready and MarketPosition == 0 and High>= Hiband ) //做多条件
{
MyEntryPrice1 = Max ( Open , Hiband);
Buy (Lots , MyEntryPrice1);
}
//多单止损
If (MarketPosition==1 )
{
If( Low<=StopPrice1)
{
StopPrice1 = MyEntryPrice1 - N*MinPoint;//定义多单止损条件
Sell(LOTS,Min(Open,StopPrice1));
}
}
//判断是否入场做空
If(timeready and MarketPosition == 0 and Low<= Loband)
{
MyEntryPrice2 = Min ( Open , Loband);
SellShort (Lots , MyEntryPrice2);
}
//空单止损
If(MarketPosition==-1)
{
If(High>=StopPrice2)
{
StopPrice2 = MyEntryPrice2 + N*MinPoint;//定义空单止损条件
BuyToCover(LOTS,Max(Open,StopPrice2));
}
}
If(MarketPosition==1 and Time>=0.1459 and time < 0.2100 ) //14:59出场
{
Sell(0,Open);
BuyToCover(0,Open);
}
end
写交易程序太难了。。各位牛人给点信心吧 |
|