shimoda94

TD Sequential (MA 1.0)

3673 lượt xem
777

Hi.
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
Phát hành các Ghi chú: 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
Phát hành các Ghi chú: Updated text at end of setup and countdown phases
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích

Bình luận

Thanks shimoda94,

This num_hundreds() function should work.

replace:

//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

with:

num_hundreds(value) =>
f = floor(value / 100)
h = value > 0 and value % 100 == 0 ? f-1 : f
+1 Phản hồi
banacek banacek
Make sure you indent the 2 function lines above. For some reason they were stripped whilst posting.
Phản hồi
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.

/mats
Phản hồi
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?
Phản hồi
I added the indicator to my favorites and enabled, but I'm not see any numbers?
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất