过去发生情况时获取条形图索引
Get Bar Index when a condition happened in the past
我想在最后一个空头条件发生时获取柱索引并获取数字并将其存储为一个值以便我以后可以使用它。
i want to get the number " 33 " -- Click to See the Picture--
您可以使用内置的 barsince 来计算条件以来的柱数,以及 valuewhen 函数在它发生时获取某事物的值
since = ta.barssince(short)
val = ta.valuewhen(short, close, 0)
for valuewhen you use the condition, then you want value, then the numbers before that condition happened.计数从 0 开始,所以 0 是最后一次出现,1 是倒数第二个,依此类推。
祝您编码和交易顺利
我想在最后一个空头条件发生时获取柱索引并获取数字并将其存储为一个值以便我以后可以使用它。
i want to get the number " 33 " -- Click to See the Picture--
您可以使用内置的 barsince 来计算条件以来的柱数,以及 valuewhen 函数在它发生时获取某事物的值
since = ta.barssince(short)
val = ta.valuewhen(short, close, 0)
for valuewhen you use the condition, then you want value, then the numbers before that condition happened.计数从 0 开始,所以 0 是最后一次出现,1 是倒数第二个,依此类推。
祝您编码和交易顺利