Lost using pine script, maybe someone out there can help

BITSTAMP:BTCUSD   Bitcoin / U.S. Dollar
602 2 4
Hello all, I have been trying to put my Delacour Index on TradingView and have run into a brick wall. If anyone out there knows the solution your assistance would be greatly appreciated.
The DI measures 13 different indicators over three different time frames (D,W,M). Included in this chart is one of the indicators, 'Willy' for daily and weekly. I have included the calculation code of the indicators (modified W%R study) in each pane and the basic call for the data sets in the price pane.
The problem I am having is when I change the time frame reference for the chart the indicators change and that should not happen. Regardless of what time frame the user requests the indicators should not change. Why are they changing? In this example, when I select a daily chart I get screwy data for the weekly study. W%R can not go below -100 so a reading of -160 doesn't make sense...

Can anyone explain what is going on here and how I overcome this problem. Again, any help would be greatly appreciated.


The Rational Investor
The readings are changing in the different timeframes due to sampling rates, and unfortunately, it can't be fixed. For a monthly chart, the daily chart gets sampled at way less frequent interval. Same in the minute scales, if you open a monthly variable in a script on a 5-minute chart, the monthly calculation takes into account more granularity due to being in the lower timescale.
Chris Moody is the house expert on pine script. He is awesome and if he can get sometime probably is the one who can help solve this. If not Lazybear is also sick at Pine
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out