cmthoman

Bar Percent Complete

cmthoman Mis à jour   
This is an example script for checking how far the current bar has progressed towards it's completed state. This works for any time frame, eliminating extra logic calls and conversions for each timeframe.period. It is not intended to be a standalone indicator, but rather as a resource for additional logic triggers on the real time bar of a pine script.

The main caveat is that pine script calculations occur on a per-tick basis. This means that the completion percentage can exceed the percentage threshold before any logic is executed. This happens when the next tick occurs after the threshold. The relevance then will depend on the activity of the underlying asset. Longer time frames on low activity assets will likely be more relevant than their shorter time frame counterparts.
Notes de version:
Small update to include resetting the conditionMet on the first tick of a new bar before calculations are made.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?