OPEN-SOURCE SCRIPT
Custom Timeframe Candles [Metrify]

This script lets you build custom timeframe candles (like 7m, 11m, 2h, 3D, etc.) by manually aggregating price data from a lower chart timeframe.
While it doesn’t fully replace TradingView’s native custom TF — especially in terms of perfect timestamp alignment, it gives you a very close (same calculation) and practical alternative for analysis.
How it works
While it doesn’t fully replace TradingView’s native custom TF — especially in terms of perfect timestamp alignment, it gives you a very close (same calculation) and practical alternative for analysis.
How it works
- Candles are manually aggregated from the current chart timeframe
- Instead of relying on request.security(), candles are constructed directly from the current chart data.
- For best results, use a chart timeframe that is divisible and as close as possible to your custom timeframe
- Example: Custom TF = 10m → use 5m chart (1m chart also works, but the gap will be larger and less efficient)
- Smaller gaps = cleaner candles, better visual accuracy, and smoother updates
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.