如何输入交易策略,以便准确分别记录“进多/出多”和“进空/出空”头寸?
// LONG
strategy.order("LONG", strategy.long, when = window() and buy) // buy long when "within window of time" AND crossover
strategy.order("SHORT", strategy.short, when = window() and sell) // sell long when "within window of time" AND crossunder
// SHORT
strategy.order("SHORT", strategy.short, when = window() and sell and shouldTrade) // buy long when "within window of time" AND crossover
strategy.order("LONG", strategy.long, when = window() and buy and shouldTrade)
但正如你在图片中看到的,它只显示“ENTER LONG / EXIT LONG”,它完全忽略了从“Enter SHORT / EXIT SHORT”获得的利润,它甚至没有显示。