NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-04-2008, 02:31 AM   #1
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Lightbulb Commitment of Traders (COT) indicator

Regardless of the market being traded, I think the CFTC Commitment of Traders report provides invaluable information on where the "Big Boys" are in the market. Personally, I've found using the COT data can be VERY effective as an overall directional filter in strategies. Use your system for timing, but only trade in the direction of large specs or commercials, which usually also happens to be the opposite direction as the general public. A further advantage of a COT indicator is that it makes absolutely no reference to price like every other indicator, so it gives a unique angle on the market.

Unfortunately there is no way to use this information in NinjaTrader at the moment. There are COT indicators for other platforms but most of them seem to be subscription based, very expensive or both, and while I wouldn't mind paying a subscription fee, I'd rather not when the data itself is free.

Example of a great COT indicator.
http://www.commitmentoftraders.com/cotexamples.htm





I've attached a screenshot, and a non-functional skeleton indicator as an idea on how an this indicator could work. Basically a drop down menu to select the desired market, 3 lines for the Large/Small Specs and the Commercials, a bar graph for open interest and perhaps the option to displace the data back three days so it plots based on the reporting date rather than the date the data is released.

This would be slightly advanced to program, but basically all that should be needed is knowledge/experience on how to work with comma-delimited text files (not me ).

Data Example:
Code:
"Market and Exchange Names","As of Date in Form YYMMDD","As of Date in Form YYYY-MM-DD","CFTC Contract Market Code","CFTC Market Code in Initials","CFTC Region Code","CFTC Commodity Code","Open Interest (All)","Noncommercial Positions-Long (All)","Noncommercial Positions-Short (All)","Noncommercial Positions-Spreading (All)","Commercial Positions-Long (All)","Commercial Positions-Short (All)"," Total Reportable Positions-Long (All)","Total Reportable Positions-Short (All)","Nonreportable Positions-Long (All)","Nonreportable Positions-Short (All)","Open Interest (Old)","Noncommercial Positions-Long (Old)","Noncommercial Positions-Short (Old)","Noncommercial Positions-Spreading (Old)","Commercial Positions-Long (Old)","Commercial Positions-Short (Old)","Total Reportable Positions-Long (Old)","Total Reportable Positions-Short (Old)","Nonreportable Positions-Long (Old)","Nonreportable Positions-Short (Old)","Open Interest (Other)","Noncommercial Positions-Long (Other)","Noncommercial Positions-Short (Other)","Noncommercial Positions-Spreading (Other)","Commercial Positions-Long (Other)","Commercial Positions-Short (Other)","Total Reportable Positions-Long (Other)","Total Reportable Positions-Short (Other)","Nonreportable Positions-Long (Other)","Nonreportable Positions-Short (Other)","Change in Open Interest (All)","Change in Noncommercial-Long (All)","Change in Noncommercial-Short (All)","Change in Noncommercial-Spreading (All)","Change in Commercial-Long (All)","Change in Commercial-Short (All)","Change in Total Reportable-Long (All)","Change in Total Reportable-Short (All)","Change in Nonreportable-Long (All)","Change in Nonreportable-Short (All)","% of Open Interest (OI) (All)","% of OI-Noncommercial-Long (All)","% of OI-Noncommercial-Short (All)","% of OI-Noncommercial-Spreading (All)","% of OI-Commercial-Long (All)","% of OI-Commercial-Short (All)","% of OI-Total Reportable-Long (All)","% of OI-Total Reportable-Short (All)","% of OI-Nonreportable-Long (All)","% of OI-Nonreportable-Short (All)","% of Open Interest (OI)(Old)","% of OI-Noncommercial-Long (Old)","% of OI-Noncommercial-Short (Old)","% of OI-Noncommercial-Spreading (Old)","% of OI-Commercial-Long (Old)","% of OI-Commercial-Short (Old)","% of OI-Total Reportable-Long (Old)","% of OI-Total Reportable-Short (Old)","% of OI-Nonreportable-Long (Old)","% of OI-Nonreportable-Short (Old)","% of Open Interest (OI) (Other)","% of OI-Noncommercial-Long (Other)","% of OI-Noncommercial-Short (Other)","% of OI-Noncommercial-Spreading (Other)","% of OI-Commercial-Long (Other)","% of OI-Commercial-Short (Other)","% of OI-Total Reportable-Long (Other)","% of OI-Total Reportable-Short (Other)","% of OI-Nonreportable-Long (Other)","% of OI-Nonreportable-Short (Other)","Traders-Total (All)","Traders-Noncommercial-Long (All)","Traders-Noncommercial-Short (All)","Traders-Noncommercial-Spreading (All)","Traders-Commercial-Long (All)","Traders-Commercial-Short (All)","Traders-Total Reportable-Long (All)","Traders-Total Reportable-Short (All)","Traders-Total (Old)","Traders-Noncommercial-Long (Old)","Traders-Noncommercial-Short (Old)","Traders-Noncommercial-Spreading (Old)","Traders-Commercial-Long (Old)","Traders-Commercial-Short (Old)","Traders-Total Reportable-Long (Old)","Traders-Total Reportable-Short (Old)","Traders-Total (Other)","Traders-Noncommercial-Long (Other)","Traders-Noncommercial-Short (Other)","Traders-Noncommercial-Spreading (Other)","Traders-Commercial-Long (Other)","Traders-Commercial-Short (Other)","Traders-Total Reportable-Long (Other)","Traders-Total Reportable-Short (Other)","Concentration-Gross LT = 4 TDR-Long (All)","Concentration-Gross LT =4 TDR-Short (All)","Concentration-Gross LT =8 TDR-Long (All)","Concentration-Gross LT =8 TDR-Short (All)","Concentration-Net LT =4 TDR-Long (All)","Concentration-Net LT =4 TDR-Short (All)","Concentration-Net LT =8 TDR-Long (All)","Concentration-Net LT =8 TDR-Short (All)","Concentration-Gross LT =4 TDR-Long (Old)","Concentration-Gross LT =4 TDR-Short (Old)","Concentration-Gross LT =8 TDR-Long (Old)","Concentration-Gross LT =8 TDR-Short (Old)","Concentration-Net LT =4 TDR-Long (Old)","Concentration-Net LT =4 TDR-Short (Old)","Concentration-Net LT =8 TDR-Long (Old)","Concentration-Net LT =8 TDR-Short (Old)","Concentration-Gross LT =4 TDR-Long (Other)","Concentration-Gross LT =4 TDR-Short(Other)","Concentration-Gross LT =8 TDR-Long (Other)","Concentration-Gross LT =8 TDR-Short(Other)","Concentration-Net LT =4 TDR-Long (Other)","Concentration-Net LT =4 TDR-Short (Other)","Concentration-Net LT =8 TDR-Long (Other)","Concentration-Net LT =8 TDR-Short (Other)","Contract Units","CFTC Contract Market Code (Quotes)","CFTC Market Code in Initials (Quotes)","CFTC Commodity Code (Quotes)" 
"WHEAT - CHICAGO BOARD OF TRADE" ,081118 ,2008-11-18,001602 ,CBT ,00 ,001 ,  297518,   68830,   68897,   64834,  140226,  117548,  273890,  251279,   23628,   46239,  207360,   68511,   63729,   33218,   87298,   78891,  189027,  175838,   18333,   31522,   90158,   26430,   31279,    5505,   52928,   38657,   84863,   75441,    5295,   14717,   10858,    2185,   -6017,    3918,    8058,   14771,   14161,   12672,   -3303,   -1814,  100.0,   23.1,   23.2,   21.8,   47.1,   39.5,   92.1,   84.5,    7.9,   15.5,  100.0,   33.0,   30.7,   16.0,   42.1,   38.0,   91.2,   84.8,    8.8,   15.2,  100.0,   29.3,   34.7,    6.1,   58.7,   42.9,   94.1,   83.7,    5.9,   16.3,    330,     66,    115,    136,     64,     88,    239,    280,    323,    101,    100,    104,     59,     81,    220,    249,    191,     29,     79,     30,     40,     74,     89,    166,    21.3,    12.1,    33.0,    19.0,    17.9,    10.0,    28.0,    15.9,    16.8,    13.9,    28.2,    22.2,    15.8,    12.8,    26.6,    20.7,    59.1,    14.4,    70.1,    23.7,    58.9,    13.1,    69.3,    21.7,"(CONTRACTS OF 5,000 BUSHELS)" ,"001602" ,"CBT" ,"001"
The yearly data in text format (updated weekly) is available here:
http://www.cftc.gov/files/dea/history/deacot2008.zip

and the updated weekly data is available here:
http://www.cftc.gov/dea/futures/deacmesf.htm

Ideally it would be great if the indicator could grab the data from the web on its own, but as its only updated once a week, I don't see it being a big deal to manually download it every week.

More info on COT:

http://www.cotstimer.blogspot.com/
http://emini-watch.com/category/commitment-of-traders/
http://www.timingcharts.com/
Attached Images
File Type: jpg YEN COT Chart 2007-2008a.jpg (71.4 KB, 472 views)
Attached Files
File Type: zip COTPlot.zip (2.1 KB, 487 views)
Elliott Wave is offline  
Reply With Quote
Old 12-04-2008, 05:46 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Hi Elliott Wave,

Thanks for posting your ideas and your skeleton COT indicator.

I will forward it promptly to our development team!

Have a great day!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-05-2008, 01:12 AM   #3
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

I've found a COT indicator in MetaTrader format.

The downside is although it reads CSV files, the columns are not the same as the CFTC website, so it would need to be adapted to the CFTC format to avoid the need for any subscription.

http://shup.com/Shup/89523/COT4MetaTrader.zip
Elliott Wave is offline  
Reply With Quote
Old 12-08-2008, 02:34 PM   #4
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

Another COT indicator in TradeStation format.

http://emini-watch.com/uploads/code/...COT_2JUN08.zip
Elliott Wave is offline  
Reply With Quote
Old 12-14-2008, 11:45 AM   #5
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default Cot Report in NinjaTrader format

Take a look at this post:

http://www.ninjatrader-support2.com/...6994#post66994

thanks,
jr.
www.jrbolsa.com
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 11:46 AM   #6
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default Cot Report in NinjaTrader format

Excuse me, the post is:
http://www.ninjatrader-support2.com/...ad.php?p=66994

regards,
jr.
www.jrbolsa.com
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 11:51 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Hi jrbolsa,
Great to see your persistence at work - thanks for posting!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-14-2008, 12:50 PM   #8
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

I'm liking what I see so far.

Does your indicator use the file format of the CFTC?

Also, while parsing CSV files may not be my thing, I would be glad to help out in any other areas (visual improvements, translation etc), just let me know.

...
An interesting interview with Larry Williams on the COT:
http://www.financialsense.com/transc.../Williams.html
Last edited by Elliott Wave; 12-14-2008 at 12:52 PM.
Elliott Wave is offline  
Reply With Quote
Old 12-14-2008, 01:31 PM   #9
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default

Very much and hard work:
My intention is to have several indicators related to cot report:

- jrCotixC (Commercials net position)
- jrCotixN (Non-commercials net position)
- jrCotixS (Small spec net position)
- jrCotixO (Open Interest)

- jrCotixCP (Commercials percentualized) (the index of L. Williams)
- jrCotixNP (Non-commercials percent.)
- jrCotixSP (Small percent.)
- jrCotixOP (Open Interest percent.)

- jrCotixCL (net Commercials Long)
- jrCotixCS (net Commercials Short)
- jrCotixCLP (Commercials Long percent.)
- jrCotixCSP (Commercials Short percent.)

- jrCotixCLtoOI (Commercials Long to Open Interest)
- jrCotixCStoOI (Commercials Short to Open Interest)
- jrCotixCtoOI (net Commercials (long-short) to Open Interest)
- jrCotixCtoOIP (Commercials (long-short) to Open Interest percent.)

But first i must be sure with ninjatrader. I need to know if the same data has the same name with every vendor (it's not the same "S&P" and "SP500").

After that i have to check the fastest way (i have to different "jrCotixC", one faster than the other).

I'm now downloading the data from de cftc but my intention is to have it automatically.

And finally and if you know L.W. I have two great - and better - indicators than this "family": one is the seasonality (LW speaks a lot about it) - i called it "jrSeasix", and the other one, a great great indicator: it does the same like these ones but for every data you have (every index, or stock or whatever): jrCotProx (Listening the LWU in his website and with much mathematics I could imagine what he was doing). If you understand spanish you can check them in www.jrbolsa.com (since april more or less, when i discovered this all).

Regards,
jr.
www.jrbolsa.com
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 01:37 PM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Great jrbolsa, to see which symbols are setup in our Instrument Manager, please disconnect from any datafeed / broker and go to Tools > Instrument Manager and browse the different categories of symbols.

http://www.ninjatrader-support.com/H...struments.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-14-2008, 01:38 PM   #11
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default

I forgot...
You can see me looking for "cot report youtube" in google. These are the links (but you must understand spanish):
http://www.youtube.com/watch?v=vOjW4Nl86kA
http://www.youtube.com/watch?v=ORv13kiHeos

thanks,
jr.
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 01:44 PM   #12
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default

Thanks a lot Bertrand. I'm very pleased to meet people like you all (Dan, Josh, you...). I haven't ever seen so quick answers.

regards,
jr.
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 01:49 PM   #13
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Thank you jrbolsa!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-14-2008, 02:56 PM   #14
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default NINJATRADER - COT REPORT: new advance

This was faster than i thought.

jrCotixCP (commercials net percentualized):
http://www.jrbolsa.com/081214nt2.htm
(this is the cot proxy of Larry Williams).
It would be better understood with commodities (soybean, oat, wheat, corn, ...) but i have to programm with the SP500 (yahoo.com) until i register with a data vendor.


regards,
jr.
www.jrbolsa.com
jrbolsa is offline  
Reply With Quote
Old 12-14-2008, 04:07 PM   #15
jrbolsa
Member
 
Join Date: Dec 2008
Location: Madrid
Posts: 98
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to jrbolsa
Default

Error:

I meant the COT INDEX of Larry Williams.

(The Cot Proxy is another indicator - I have it too, but only in VisualChart. Soon in Ninjatrader although i think that i'll have to stop for a couple of weeks due to Christmas holidays and modifications that i need to do in the information downloaded from cftc).

jr.
www.jrbolsa.com
jrbolsa is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
COT Indicator bwall Indicator Development 8 12-14-2008 11:51 AM
Traders Expo NYC redrum28 Suggestions And Feedback 1 02-13-2008 04:03 AM
Traders Lament zoltran Miscellaneous Support 1 11-18-2007 10:55 PM
2 or more traders using Ninja Shiva Swinger Miscellaneous Support 1 02-23-2007 02:29 AM
Traders, can you assist? ETemp Connecting 6 02-20-2007 07:36 AM


All times are GMT -6. The time now is 09:32 PM.