OPEN-SOURCE SCRIPT

Crossover Counter

Explanation:
Crossover Detection: We detect the crossover of the 20-period and 50-period moving averages using ta.crossover().
Tracking Price Movement: After the crossover, we start tracking the price to check if it moves up or down by 2%. If an up movement occurs before a down movement, we increment the positive counter. If a down movement occurs first, we increment the negative counter.
Reset Condition: Once either a 2% up or down move is detected, we stop tracking until the next crossover.
Table Display: A table shows the counts of positive and negative events.
CyclesMoving AveragesPine utilities

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明