自从它购买以来,我正在尝试获得蜡烛的数量。
我是说
if ( something_happens )
strategy.entry("buy", strategy.long)
How could I get this?
candles_since_entry = barssince(bought)
答案 0 :(得分:0)
//@version=4
study("My Script")
var bool something_happens = true
var int bar_entry = na
if (something_happens)
// strategy.entry("buy", strategy.long)
bar_entry := bar_index
candles_since_entry = bar_index - bar_entry
plot(na)