I have started using NT only about 6 month ago, but I find it so fantastic that I sometimes cannot stop developping stuff for it.
NT is great and the C# language is so powerful and flexible that up to now I always managed to do what I want in NT.
Since I had never parsed http , here a code for reading the
COT data from the
website.
The Cot indicator presented will
- read current or archive COT Report directly from the cftc.gov web site.
- parse all this into a Commitment class
- Print in an Indicator the Long/Short/Spread Positions for Commercial/NonCommercial or NonReportable participants.
- limitiations:
- some parts of the code unfinished.
- DateTime is working for GMT+1, as hours are hardcoded into.
for EST some hour offsets are needed
- load time is long as the indicator will download (from within OnBarUpdate) all reports needed from cftc.gov
I would like to offer my source code here under the Limited GNU Public Licence,hence you can use the code for yourself but you may not distribute it further without notice to me, please through this forum.
Commercial use of is prohibited.
Here a screenshot:
COT offers OpenInterest for each participant group, so please select
Contract-USTreasuryBonds and OpenInterest-Short
and try out.
Actually there is quite much thinking in this code and I put in here in the hope to get a nice general discussion out of it, and I also hope to get good ideas and good tips from others
Best regards
Andreas (zweistein)
Comment