布林线放在副图

编写代码,在副图显示布林线,需带K线,但是设置之后,只显示上中下轨,没显示K线,请问该怎么调整?

时间日期参数呢?没有这个怎么画?

回复:怎么添加

回复:https://tbq.tbquant.net/helper?product_id=999&keyword=3794&content_id=2631&selectedkey=3858&type=article#3.4-kline-%E7%BB%98%E5%88%B6k%E7%BA%BF%E5%9B%BE 跟案例比一比看看少了什么

回复:

回复://------------------------------------------------------------------------ // 简称: BOLLX // 名称: 布林通道 // 类别: 策略应用 // 类型: 内建应用 //------------------------------------------------------------------------ Params Numeric Length(20); //周期 Numeric Offset(2); //标准差倍数 Vars Numeric UpLine; //上轨 Numeric DownLine; //下轨 Series<Numeric> MidLine; //中间线 Numeric Band; Plot plt; Bar myBar; Events OnReady() { SetBackBarMaxCount(1+Length); Range[0:DataSourceSize() - 1] { setPlotOption("MidLine", "begin-bar", Length); setPlotOption("UpLine", "begin-bar", Length); setPlotOption("DownLine", "begin-bar", Length); } plt.figure(); plt.setOption("x-format","time");//K线不需要显示设置 } OnBar(ArrayRef<Integer> indexs) { Range[0:DataSourceSize() - 1] { MidLine = AverageFC(Close,Length); Band = StandardDev(Close,Length,2); UpLine = MidLine + Offset * Band; DownLine = MidLine - Offset * Band; PlotNumeric("UpLine",UpLine); PlotNumeric("DownLine",DownLine); PlotNumeric("MidLine",MidLine); myBar.open=Open(); myBar.high=High(); myBar.low=Low(); myBar.close=Close(); myBar.volume=Vol(); myBar.openInt=OpenInt(); myBar.turnOver=turnOver(); plt.kline("kline",myBar); } } //------------------------------------------------------------------------ // 编译版本 GS2010.12.08 // 版权所有 TradeBlazer Software 2003-2025 // 更改声明 TradeBlazer Software保留对TradeBlazer平 // 台每一版本的TradeBlazer公式修改和重写的权利 //------------------------------------------------------------------------

回复:怎么是这种状态

回复:这是案例给的代码这是你给的代码。你不觉得你少了一行吗?一定要说得这么详细吗??

回复:加上了,显示这种,没有上中下轨道?

回复://------------------------------------------------------------------------ // 简称: BOLLX // 名称: 布林通道 // 类别: 策略应用 // 类型: 内建应用 //------------------------------------------------------------------------ Params Numeric Length(20); //周期 Numeric Offset(2); //标准差倍数 Vars Numeric UpLine; //上轨 Numeric DownLine; //下轨 Series<Numeric> MidLine; //中间线 Numeric Band; Plot plt; Bar myBar; Events OnReady() { SetBackBarMaxCount(1+Length); Range[0:DataSourceSize() - 1] { setPlotOption("MidLine", "begin-bar", Length); setPlotOption("UpLine", "begin-bar", Length); setPlotOption("DownLine", "begin-bar", Length); } plt.figure(); plt.setOption("x-format","time");//K线不需要显示设置 } OnBar(ArrayRef<Integer> indexs) { Range[0:DataSourceSize() - 1] { MidLine = AverageFC(Close,Length); Band = StandardDev(Close,Length,2); UpLine = MidLine + Offset * Band; DownLine = MidLine - Offset * Band; PlotNumeric("UpLine",UpLine); PlotNumeric("DownLine",DownLine); PlotNumeric("MidLine",MidLine); myBar.dateTime=date+time; myBar.open=Open(); myBar.high=High(); myBar.low=Low(); myBar.close=Close(); myBar.volume=Vol(); myBar.openInt=OpenInt(); myBar.turnOver=turnOver(); plt.kline("kline",myBar); } } //------------------------------------------------------------------------ // 编译版本 GS2010.12.08 // 版权所有 TradeBlazer Software 2003-2025 // 更改声明 TradeBlazer Software保留对TradeBlazer平 // 台每一版本的TradeBlazer公式修改和重写的权利 //------------------------------------------------------------------------

回复:怎么分成两个副图了

回复:用一个画笔画boll也用 plt.line

//------------------------------------------------------------------------ // 简称: BOLLX // 名称: 布林通道 // 类别: 策略应用 // 类型: 内建应用 //------------------------------------------------------------------------ Params Numeric Length(20); //周期 Numeric Offset(2); //标准差倍数 Vars Numeric UpLine; //上轨 Numeric DownLine; //下轨 Series<Numeric> MidLine; //中间线 Numeric Band; Plot plt; Bar myBar; Events OnReady() { SetBackBarMaxCount(1+Length); Range[0:DataSourceSize() - 1] { setPlotOption("MidLine", "begin-bar", Length); setPlotOption("UpLine", "begin-bar", Length); setPlotOption("DownLine", "begin-bar", Length); } } OnBar(ArrayRef<Integer> indexs) { Range[0:DataSourceSize() - 1] { MidLine = AverageFC(Close,Length); Band = StandardDev(Close,Length,2); UpLine = MidLine + Offset * Band; DownLine = MidLine - Offset * Band; PlotNumeric("UpLine",UpLine); PlotNumeric("DownLine",DownLine); PlotNumeric("MidLine",MidLine); myBar.open=Open(); myBar.high=High(); myBar.low=Low(); myBar.close=Close(); myBar.volume=Vol(); myBar.openInt=OpenInt(); myBar.turnOver=turnOver(); plt.kline("kline",myBar); } } //------------------------------------------------------------------------ // 编译版本 GS2010.12.08 // 版权所有 TradeBlazer Software 2003-2025 // 更改声明 TradeBlazer Software保留对TradeBlazer平 // 台每一版本的TradeBlazer公式修改和重写的权利 //------------------------------------------------------------------------