3

I am trying to pull volume of stocks from different securities to analyze them. However, the volume from the security() command seems different to the standard volume command. I have made sure they are part of the same timeframe. My code is simple:

v1 = security("NASDAQ:ADP",timeframe.period,volume)
plot(v1)
plot(volume)

The results I get can be seen here, where the first number is the output v1

mingos
  • 31
  • 3
  • On a 5 min timeframe I can display bars from higher timeframes ex. 1h but I can't color based on volume from higher timeframes, terrible. Same issue as you with security function, why even provide volume if it's inaccurate? – CrHasher Jul 21 '22 at 17:54

1 Answers1

0

I was also having discrepancies, I got the answer from the below link.

https://www.pinecoders.com/faq_and_code/

Can I create an indicator that plots like the built-in Volume or Volume Profile indicators? No. A few of the built-in indicators TradingView publishes are written in JavaScript because their behavior cannot be replicated in Pine. The Volume and Volume Profile indicators are among those. This Stack Overflow answer provides an imperfect workaround.

Tradingview Pine script - how can I make custom volume indicator behave like a built-in Vol

frien_dd
  • 154
  • 2
  • 12