我的代码,我明确指定应在偶数柱上制作入场订单
//@version=5
strategy("TEST STRATEGY 2", overlay=true)
backtestStartDate = input.time(timestamp("01 Apr 2023 12:05:00 GMT+02:00"), title="Start Date", group="Backtest Time Period")
backtestEndDate = input.time(timestamp("01 Apr 2023 12:15:00 GMT+02:00"), title="End Date", group="Backtest Time Period")
inTradeWindow = time > backtestStartDate and time <= backtestEndDate
if inTradeWindow
if bar_index % 2 == 0
strategy.entry("My Long Entry", strategy.long)
else
strategy.close("My Short Entry")
a = str.tostring(bar_index)
label.new(bar_index, na, a, yloc = yloc.abovebar, size = size.normal,textcolor = color.white)
然而,恰恰相反: