{
  "strategyId": "microcap_volume_trend_000852",
  "version": "2",
  "parser": "omniquant-engine-script-v2",
  "market": "CN_A",
  "signalSymbol": "000852.SH",
  "benchmark": {
    "instrumentId": "000852.SH",
    "fallbackInstrumentId": "000852.SH"
  },
  "engineConfig": {
    "market": "CN_A",
    "signalSymbol": "000852.SH",
    "benchmarkSymbol": "000852.SH",
    "refreshRate": 15,
    "rankLimit": 40
  },
  "runtimeExpressions": {
    "prelude": "let refresh_rate = 15;\nlet stocknum = 40;\nlet close_rate = 1.07;\nlet loss_rate = 0.93;\nlet rsi_rate = 1.0001;\nlet trade_rate = 0.5;\nlet xs = 4 / 500;\nlet base_index_level = 2000;\nlet base_cap_floor = 3;\nlet base_cap_ceiling = 28;\nfn band_start(current_price, base_index_level, xs, base_cap_floor) {\n  if current_price == base_index_level {\n    base_cap_floor\n  } else if current_price > 0 {\n    round((current_price - base_index_level) * xs + base_cap_floor)\n  } else {\n    base_cap_floor\n  }\n}\nfn band_end(current_price, base_index_level, xs, base_cap_ceiling) {\n  if current_price == base_index_level {\n    base_cap_ceiling\n  } else if current_price > 0 {\n    round((current_price - base_index_level) * xs + base_cap_ceiling)\n  } else {\n    base_cap_ceiling\n  }\n}",
    "selection": {
      "limitExpr": "stocknum",
      "marketCapField": "market_cap",
      "marketCapLowerExpr": "band_start(signal_close, base_index_level, xs, base_cap_floor)",
      "marketCapUpperExpr": "band_end(signal_close, base_index_level, xs, base_cap_ceiling)",
      "stockFilterExpr": "stock_ma5 > stock_ma10 * rsi_rate && stock_ma10 > stock_ma30 * rsi_rate && rolling_mean(\"volume\", 5) < rolling_mean(\"volume\", 60)"
    },
    "risk": {
      "exposureExpr": "signal_ma5 > signal_ma10 * rsi_rate ? 1.0 : trade_rate",
      "stopLossExpr": "loss_rate",
      "takeProfitExpr": "close_rate"
    },
    "allocation": {
      "buyScaleExpr": "touched_upper_limit ? 1.0 : trade_rate"
    },
    "ordering": {
      "rankBy": "market_cap",
      "rankExpr": "",
      "rankOrder": "asc"
    }
  }
}
