algobar

Strategy weekly results as numbers v1

This script is based on an idea of monthly statistics that have been found across tradingview community scripts. This is an improved version with weekly results with the ability to define the size of every group (number of weeks within one group).

Initial setup of the strategy
1. Set the period to calculate the results between.
2. Set the statistic precision and group size.
3. Enable "Recalculate" → "On every tick" under the strategy "Properties" section.

The logic under the hood
1. Get the period between which to calculate the strategy.
2. Calculate the first day of the first week within the period.
3. Calculate the latest day of the latest week within the period.
4. Calculate the results of the selected period.
5. Group the values by the defined number of cells.
6. Calculate the summary of every group.
7. Render the table.

Please, be careful. To use this tool you will need to enable the "Recalculate" → "On every tick" option but it means that your strategy will be executed on every tick instead of bar close. It can cause unexpected results in your strategy behaviour.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?