开拓者真实波动率轨道突破策略 适用15M,30M 指数合约 等
//适用软件:交易开拓者
//公式名称:波动率轨道突破策略
//数据周期:15M,30M等
//数据合约:指数合约
//交易合约:主力合约
//适合品种:商品期货
Params
Numeric Length1(300);
Numeric Length2(100);
Numeric N(2);
Numeric Fund(20000);
Vars
NumericSeries Midline(0);
NumericSeries upBand(0);
NumericSeries downBand(0);
NumericSeries Lots(0);
NumericSeries Myprice(0);
Begin
If(!CallAuctionFilter()) Return;
Midline= Average((High + Low + Close)/3,Length1);
upBand = Midline+ N*AvgTrueRange(Length2);
downBand = Midline - N*AvgTrueRange(Length2);
//PlotNumeric("Midline",Midline,0,Blue);
//PlotNumeric("upBand",upBand,0,Yellow);
//PlotNumeric("downBand",downBand,0,White);
Lots=max(1,intpart(Fund/(O*ContractUnit*BigPointValue*0.1)));
If(MarketPosition <> 1 and close[1]>= upBand[1] and close[2]<upband[2])
{
Myprice=open;
Buy(lots,Myprice);
}
If(MarketPosition <> -1 and close[1] <= downBand[1] and close[2]>downband[2])
{
Myprice=open;
SellShort(lots,Myprice);
}
If(MarketPosition == 1 and BarsSinceEntry >= 1 and C[1]<= Midline[1] )
{
Myprice=open;
Sell(0,Myprice);
}
If(MarketPosition == -1 and BarsSinceEntry >= 1 and C[1] >= Midline[1])
{
Myprice=open;
BuyToCover(0,Myprice);
}
End
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 我与微信审核的“相爱相杀”看个人小程序副业
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· spring官宣接入deepseek,真的太香了~