TD Sequential (MA 1.0)

3118 görüntülenme
3118 5

Inspired by glaz TD-Sequential script I wrote my own to also include the TD-Countdown phase.
It is not perfect by any means yet.

A problem is the 'num_hundreds' function which is needed to calculate the next number in the TD-Countdown phase if the numbers are not sequential. At the moment it can handle max 9 non-sequential bars.
It should need to be updated to a for-loop but I could not get that working.
If anyone has a fix for that, you are welcome to do it and please also send me an update.

We plot the setup phase with green or red numbers 1..9 above the bars. If we reach a 9 we insert a red or green triangle at top or bottom with text 'SELL (S)' or 'BUY (S') (S) indicates that that the setup phase is finished
We then start the countdown phase and plots lime or maroon numbers 1..13 below the bars. If we reach 13 we insert a red or green arrow at top or bottom with text 'SELL (C)' or 'BUY (C') (C) indicates that that the countdown phase is finished

Input parameters:
PlotTheSetup = input(true)
PlotTheCountdown = input(true)
ShowSetupSells = input(true)
ShowCountdownSells = input(true)

Nov 16
Sürüm Notları: You can set your own SetupLimit between 5 and 13, default = 9
You can set your own CountdownLimit between 8 and 16, default = 13

num_hundreds function is improved thanks to @banacek
Nov 16
Sürüm Notları: Updated text at end of setup and countdown phases
Favori Komutlardan Çıkart Favori Komutlara Ekle
I added the indicator to my favorites and enabled, but I'm not see any numbers?
Cevap Gönder
Thanks shimoda94,

This num_hundreds() function should work.


//num_hundreds(value) => value > 900 ? 9 :value > 800 ? 8 :value > 700 ? 7 :value > 600 ? 6 :value > 500 ? 5 :value > 400 ? 4 :value > 300 ? 3 : value > 200 ? 2 : value > 100 ? 1 : 0


num_hundreds(value) =>
f = floor(value / 100)
h = value > 0 and value % 100 == 0 ? f-1 : f
+1 Cevap Gönder
banacek banacek
Make sure you indent the 2 function lines above. For some reason they were stripped whilst posting.
Cevap Gönder
shimoda94 banacek
@banacek, Thanks. Somehow I missed that there is a floor-function available. Am new to Pine.
Will update with this function as soon I made some other adjustments. I am not 100% sure that I have everything tuned in.

Cevap Gönder
therzma shimoda94
@shimoda94, sorry to say but the sell countdown seems to miss candles that do close above that two prior even if it's sequential. Also, what is the floor function supposed to do?
Cevap Gönder
Ana Sayfa Hisse Senedi Takipçisi Forex Takipçisi Kripto Takipçisi Ekonomik Takvim Gösterimler Nasıl Çalışır Grafik Özellikleri Ücretlendirme Kurallarımız Moderatörler Web Sitesi & Aracı Kurum Çözümleri Görsel Bileşenler(Widget) Grafik Çözümleri Hafif Grafik Kitaplığı Destek Merkezi Bir arkadaşınıza yönlendirin Yeni Özellik Talebi Blog ve Haberler SSS Viki Twitter
Profil Profil Ayarları Hesap ve Ödemeler Bir arkadaşınıza yönlendirin Destek Kayıtlarım Destek Merkezi Yayınlanmış Fikirler Takip Edenler Takip Ediliyor Özel Mesajlar Sohbet Çıkış