aalfiann

[aalfiann] Swing Trail Signal

aalfiann Cập nhật   
Description
The idea is when we want to swing trading with Trend Follower strategy.
This indicator technicaly only display the Support and Resistent with Trailing line. So we can follow the price to gain efficient profit.

Very simple strategy, clean and efficient.
Alert condition supported.

HOW TO USE
1. Buy Signal / Long Trend
The Buy Signal is appear once the resistent breakout. You can directly buy or setup for long trade after the bar is closed.

2. Sell Signal / Short Trend
The Sell signal is appear once the support breakdown. You can directly sell or setup for short trade after the bar is closed.

Concept
There are many Support and Resistent indicator out there, but mostly display two lines, support lines and resistance lines. The reason I've create this indicator is, if the Long Trend is ended, why we display the support line anymore? and vice versa.

The important thing in this indicator is how to know that the trend is ended. So that we can focus or prepare on the new trend. For example, if the Long trend is ended, then we should focus only to resistance line.

How I get into this?
Firstly, I do calculate the support and resistent per 1 candle length and multiplier 2.0 and I calculate the Average True Range atr = mult * ta.atr(length) .

After we have the ATR value, then we are able :
- To get Long Stop is by calculate ta.highest(close, length) - atr and then I compared the max value with the previous Long Stop by calculate math.max(longStop, longStopPrev).
- To get Short Stop is by calculate ta.lowest(close, length) + atr and then I compared the min value with the previous Short Stop by calculate math.min(shortStop, shortStopPrev).

How I know the direction trend has changed?
var int dir = 1
dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dir
changeCond = dir != dir


so we can draw the trailing line until the trend is ended also we will know when the trend direction is changed.
Phát hành các Ghi chú:
Now the calculation of ATR has been changed to 2 length (before is 1 length) and Multiplier still 2.0 so we can get more better resist and support line.
Phát hành các Ghi chú:
Update change calculation method to avoid false breakout and breakdown so now we will be more safe from high volatility. Before the based source price is from close, now I use hl2.

Mã được bảo vệ
Tập lệnh này được xuất bản mã nguồn đóng và bạn có thể sử dụng một cách tự do. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ. Bạn không thể xem hoặc sửa đổi mã nguồn.
Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?