OPEN-SOURCE SCRIPT

BBSS+

This Pine Script implements a custom indicator overlaying Bollinger Bands with additional features for trend analysis using Exponential Moving Averages (EMAs). Here's a breakdown of its functionality:

Bollinger Bands:
The script calculates the Bollinger Bands using a 20-period Simple Moving Average (SMA) as the basis and a multiplier of 2 for the standard deviation.
It plots the Upper Band and Lower Band in red.

EMA Calculations:
Three EMAs are calculated for the close price with periods of 5, 10, and 40.
The EMAs are plotted in green (5-period), cyan (10-period), and orange (40-period) to distinguish between them.

Trend Detection:
The script determines bullish or bearish EMA alignments:
Bullish Order: EMA 5 > EMA 10 > EMA 40.
Bearish Order: EMA 5 < EMA 10 < EMA 40.

Entry Signals:
Long Entry: Triggered when:
The close price crosses above the Upper Bollinger Band.
The Upper Band is above its 5-period SMA (indicating momentum).
The EMAs are in a bullish order.
Short Entry: Triggered when:
The close price crosses below the Lower Bollinger Band.
The Lower Band is below its 5-period SMA.
The EMAs are in a bearish order.

Trend State Tracking:
A variable tracks whether the market is in a Long or Short trend based on conditions:
A Long trend continues unless conditions for a Short Entry are met or the Upper Band dips below its average.
A Short trend continues unless conditions for a Long Entry are met or the Lower Band rises above its average.

Visual Aids:
Signal Shapes:
Triangle-up shapes indicate Long Entry points below the bar.
Triangle-down shapes indicate Short Entry points above the bar.
Bar Colors:
Green bars indicate a Long trend.
Red bars indicate a Short trend.

This script combines Bollinger Bands with EMA crossovers to generate entry signals and visualize market trends, making it a versatile tool for identifying momentum and trend reversals.
Bands and ChannelsMoving AveragesTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항