TBQ系统策略变更一下止损和止盈设置

以下策略帮我把止损设为12跳,止盈设为13跳。固定止盈止损,日内交易,收盘前平仓。 --------------------------------------------------- // 出场条件: // 1. 开多以开仓BAR的最近N根BAR的低点作为止损价 // 开空以开仓BAR的最近N根BAR的高点作为止损价 // 2. 盈利超过止损额的一定倍数止盈 // // 注: 当前策略仅为做多系统, 如需做空, 请参见CL_Escalator_S //----------------------------------------------------------------------// Params Numeric FastLength(8); // 快速均线周期 Numeric SlowLength(40); // 慢速均线周期 Numeric RiskLength(2); // 止损通道的周期数 Numeric ProfitFactor(2); // 止盈相对止损的倍数 Vars Series<Numeric> MA_Fast; // 快速均线 Series<Numeric> MA_Slow; // 慢速均线 Numeric MyRange; // K线波动范围 Series<Bool> Condition1; // 条件1 Series<Bool> Condition2; // 条件2 Series<Numeric> HH; // 周期的高点 Series<Numeric> LL; // 周期的低点 Series<Numeric> LongRisk; // 止损时的风险额 Events OnBar(ArrayRef<Integer> indexs) { // 计算及输出均线指标 MA_Fast = Average(Close,FastLength); MA_Slow = Average(Close,SlowLength); PlotNumeric("Ma_Fast",MA_Fast); PlotNumeric("Ma_Slow",MA_Slow); // 每根K线的波动范围 MyRange = High - Low; // K线形态判断的2个条件 Condition1 = Close <= Low + 0.25 * MyRange; Condition2 = Close >= High - 0.25 * MyRange; // 计算周期的高低点 HH = Highest(High,2); LL = Lowest(Low,RiskLength); // 开仓 If(MarketPosition == 0 And Condition1[2] And Condition2[1] And Close[1] > MA_Fast[1] And Close[1] > MA_Slow[1] And Vol > 0) { If(High >= HH[1] + MinMove * PriceScale) { Buy(0, Max(Open,HH[1] + MinMove * PriceScale)); LongRisk = LL[1] - MinMove * PriceScale; } } // 平仓 If(MarketPosition == 1 And BarsSinceEntry > 0 And Vol > 0) { // 止盈 If(High >= EntryPrice + ProfitFactor * (EntryPrice - LongRisk)) { Sell(0, Max(Open,EntryPrice + ProfitFactor * (EntryPrice - LongRisk))); } // 止损 Else If(Low <= LongRisk) { Sell(0, Min(Open,LongRisk)); } } } //------------------------------------------------------------------------ // 编译版本 GS2014.10.25 // 版权所有 TradeBlazer Software 2003-2025 // 更改声明 TradeBlazer Software保留对TradeBlazer平 // 台每一版本的TradeBlazer公式修改和重写的权利 //------------------------------------------------------------------------