OPEN-SOURCE SCRIPT

Segment Regression

269
As an example of the descriptive power of Pine Script, this very short example traces a 'segment regression', a result not entirely obvious with so few lines of code, repositioning them when the previous inference moves away from the graph beyond the pre-set limit.

A trick used is to restart the new inference segment
- from the maximum reached in the previous trend, when positive (slope>0)
- from the minimum reached in the previous trend, when negative (slope<0)

The result can in my opinion be easily used to build strategies.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.