You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some RSI calculations are missing on the 1 minute timeframe #41
Describe the bug
When running ta.rsi(close, 14) on a 1-minute timeframe dataset of size 1440, only 1434 RSI values are produced.
However, the correct number of results appears when using a 5-minute timeframe dataset.
"""@pyneThis code was compiled by PyneComp — the Pine Script to Python compiler.Accessible via PyneSys: https://pynesys.ioRun with open-source PyneCore: https://pynecore.org"""frompynecoreimportSeriesfrompynecore.libimport (
close, script, ta, log
)
@script.strategy("my strategy", overlay=True, initial_capital=10000)defmain():
rsi: Series[float] =ta.rsi(close, 14)
log.info("rsi: {0}", rsi)
Run the strategy pyne run test ccxt_BITGET_BTC_USDT_USDT_1.ohlcv
Observe the bar index
The final bar index is much lower than the number of rows in the OHLCV file.
Expected behavior
RSI values should be generated for every bar in the dataset.
Thank you for taking the time to report this issue and for providing such detailed reproduction steps! This is really helpful.
After investigation, this is actually expected behavior, not a bug. Here's what's happening:
The Cause: Gaps in the Data
The Bitget API doesn't return data for every minute - there are periods with no trading activity. When we downloaded the same data you used, we found:
Total records in OHLCV file: 1440
Real bars (with trading): 1434
Gap bars (no trading): 6
The gap timestamps (no trading activity from Bitget):
2025-11-25 14:20:00 UTC
2025-11-25 17:41:00 UTC
2025-11-25 21:02:00 UTC
2025-11-26 00:23:00 UTC
2025-11-26 03:44:00 UTC
2025-11-26 07:05:00 UTC
How PyneCore Handles This
When converting data to OHLCV format, PyneCore fills gaps with volume=-1 (a flat candle with previous close price)
When running scripts, these gap bars are skipped by default (skip_gaps=True)
This matches TradingView's behavior - they also skip bars with no trading activity
Why This Is Correct
Calculating RSI (or any indicator) on a "fake" bar with no real price movement would produce misleading results. The 1434 RSI values you're seeing represent all the bars where actual trading occurred.
Note: We're converting this issue to a Discussion, as we found it valuable for other users who might encounter the same situation. Thanks again for bringing this up!
Activity
wallneradam commentedon Nov 26, 2025
Thank you for taking the time to report this issue and for providing such detailed reproduction steps! This is really helpful.
After investigation, this is actually expected behavior, not a bug. Here's what's happening:
The Cause: Gaps in the Data
The Bitget API doesn't return data for every minute - there are periods with no trading activity. When we downloaded the same data you used, we found:
The gap timestamps (no trading activity from Bitget):
How PyneCore Handles This
volume=-1(a flat candle with previous close price)skip_gaps=True)Why This Is Correct
Calculating RSI (or any indicator) on a "fake" bar with no real price movement would produce misleading results. The 1434 RSI values you're seeing represent all the bars where actual trading occurred.
How to Verify
You can check for gaps in your OHLCV file:
Note: We're converting this issue to a Discussion, as we found it valuable for other users who might encounter the same situation. Thanks again for bringing this up!