Reputation: 141
What I have in mind is that I would like to have a view of Open Interest data along with the price chart so that alongside chart patterns would also get the view of where the action in Open Interest is happening.
Everyday NSE India provides file which has summary of all the closing prices and F&O data which has details of what I would like to add to the chart.
Is it possible to write a Pine Script code to read from an external file and display this Open Interest data along the vertical axis similar to how volume profile is displayed?
Live reading of Open Interest would be the best scenario but since TradingView doesn’t have F&O data for NSE India, even getting to display previous day’s data would serve the purpose.
I tried looking at the input() function but looks like it either takes the direct data related to an asset class or can be used with data derived after any calculation.. but I am unable to figure out how to use it to access data from external sources.
Thanks
Upvotes: 14
Views: 22267
Reputation: 8789
No it's not possible to import data in Pine scripts other that what is available through TV-supplied feeds. You could enter the values manually in your script's inputs and plot them if you only need a few new values every day.
If you want to import a larger set of values in a series, see this technique.
Disclosure: the link in this answer points to a PineCoders FAQ entry. I am a member of the PineCoders community and I most probably wrote that FAQ entry. PineCoders is a TradingView-supported group of volunteer Pine coders and PineCoders' website is strictly educational. Neither TradingView nor PineCoders benefits financially from sending traffic to pinecoders.com, and the site contains no affiliate/referral links.
Upvotes: 7