f10409

Strategy Based on trends evaluated at different time resolutions

f10409 Diupdate   
The trends are evaluated using moving averages (both EMA and SMA ) with different periods and time resolutions.
The default resolutions for the small, median, and large resolutions are day(D), week(W), and month(M), respectively.
And the default periods for the short, median, and long periods are moving averages are 20, 60, and 120, respectively.

The buy signal is triggered when the following conditions are all met:

@ Small resolution:
1. The distances between the short-period MA (s) and median-term MA (m), and between the median-period MA and long-term MA (l), are small (default: 0% < (1-s/m) and (1-m/l) < 5%).
2. Prices (c) > s, m, and l. i.e. c/s, c/m, and c/l > 1.0.
3. up-trends of s, m, and l.

@ Median resolution:
1. The distances between the short-period MA (s) and median-term MA (m), and between the median-period MA and long-term MA (l), are small (default: abs(1-s/m) < 3% and abs(1-m/l) < 5%).
2. Prices (c) > s, m, and l. i.e. c/s, c/m, and c/l > 1.0.
3. up-trends of s.

@ Large resolution:
1. The distances between the short-period MA (s) and median-term MA (m), and between the median-period MA and long-term MA (l), are small (default: abs(1-s/m) < 3% and abs(1-m/l) < 5%).
2. Prices (c) > s, m, and l. i.e. c/s, c/m, and c/l > 1.0.
3. Up-trend of s.

The close signal is triggered when the following conditions are all met:

@ Small resolution:
1. Prices (c) < s.
2. Down-trend of s.

On the separated chart, the s/m for different time resolutions are shown. The dotted line is the s/m calculated using EMA for the small time resolution.
The orange triangles represent when the prices are larger than all moving averages.
One can choose to have the m/l also plotted from the settings.

Attention:
1. The strategy needs to display at the smallest time resolution set in order to get correct results.
2. This strategy is for learning purpose only. Using it to make trading decisions will lead to money loss.

The design concepts are mostly inspired by 雷公.
Catatan Rilis:
some bugs fixed
Catatan Rilis:
Remove sma based s/m and m/l from chart
Catatan Rilis:
bugs fixed
Catatan Rilis:
0405
Catatan Rilis:
add input for stop loss
Skrip terproteksi
Skrip ini dipublikasikan secara closed-source dan anda dapat menggunakannya dengan bebas. Anda dapat memfavoritkannya untuk digunakan pada grafik. Anda tidak dapat melihat atau mengubah kode sumbernya.
Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.

Inggin menggunakan skrip ini pada chart?