TradingView
BeeHolder
24. Mai 2021 14:36

Performance Table 

Apple Inc.NASDAQ

Beschreibung

This indicator is based on the Performance section in the TradingView's sidebar and uses new Pine tables functionality. It compares the current price of the symbol to its past price and calculates the rate of return to make it easier to track the performance of the symbol. Note that the Performance sidebar is not updated in real-time, while this indicator is, so on real-time charts the values between the two can differ (the indicator's values are more recent).

The formula of the calculation is (Current value - Past value) * 100 / Past value, where Past value is:
  • 1W - close 5 daily bars ago
  • 1M - close 21 daily bars ago
  • 3M - close 63 daily bars ago
  • 6M - close 126 daily bars ago
  • YTD - close of the past year
  • 1Y - close 251 daily bars ago

Versionshinweise

Made a number of functional improvements:
  • Changed the calculation algorithm to fit what TV is using right now. It works better on all types of charts, including crypto, unlike the previous one, that was tied to the number of working days.
  • Added customizable timeframes. It is now possible to set up to 6 different 'Absolute' timeframes and up to 3 'To Date' ones (intraday timeframes are not supported). New timeframes can be added via the chart's Timeframe dropdown - add the custom timeframe there and it will also appear in the indicator's settings. Note that not added timeframes show up as "Chart" until you add them.
  • Added an option to customize the width of the table. The height will adjust automatically.
  • Converted to Pine v5.


P.S. Let me know if you encounter any issues with the new version.
Kommentare
reastruth
I love this, although I wish I could get lower time frames for intraday trading. Any advice on how to code for 4H, 1H, 15Min time frames?
PineCoders
LonesomeTheBlue
ppetrov_tv
Toss a coin to your tables
ThanosRising
very nice, very helpful
dgtrd
one suggestion to made it applicable for 7/24 open markets, such as crypto

crypto = syminfo.type == "crypto" or syminfo.type == "bitcoin" if barstate.islast f_fillCell(perfTable, 0, 0, f_performance(crypto ? 7 : 5), "1W") f_fillCell(perfTable, 1, 0, f_performance(crypto ? 30 : 21), "1M") f_fillCell(perfTable, 2, 0, f_performance(crypto ? 91 : 63), "3M") f_fillCell(perfTable, 0, 1, f_performance(crypto ? 182 : 126), "6M") f_fillCell(perfTable, 1, 1, f_rateOfreturn(close, lastYearClose), "YTD") f_fillCell(perfTable, 2, 1, f_performance(crypto ? 365 : 251), "1Y")
wretnuh77
@dgtrd, This helped, thanks man
SSingh18
Hello, Thanks for this indicator, just wanted to ask two things.
Is it possible to see "52 Week" High / Low stock price?
And "All Time" High / Low stock price?
PineCoders
This publication is now featured in our Editors' Picks: tradingview.com/scripts/editors-picks/ .
In the name of all TradingViewers, thank you for your valuable contribution to the community, and congrats!
BeeHolder
@PineCoders, thanks!
Mehr