NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support

Miscellaneous Support Miscellaneous support issues.

Reply
 
Thread Tools Display Modes
Old 01-09-2008, 03:47 PM   #1
wd2trade
Junior Member
 
Join Date: Nov 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default Missing Yahoo Split Data

Hello,

I've been working with NinjaTrader for the past few months and it's worked well.

Today I tried to update the split data for NVDA, and nothing was downloaded. I know this is incorrect because this stock split 3:2 on 9/11/2007. I tried a different stock (SNHY) and it downloaded the correct splits.

I'm using the Yahoo feed for split and dividend data. Is there something I'm missing?

Thanks,
Bill
wd2trade is offline  
Reply With Quote
Old 01-09-2008, 03:50 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

We will look into it and post back by tomorrow.
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-09-2008, 10:29 PM   #3
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Unfortunately YAHOO's data is inconsistent regrading NVDA: no splits nor dividends reported as request

http://finance.yahoo.com/q/hp?s=NVDA...f=2008&g=v&y=0

... is issued. No problem on SNHY though

http://finance.yahoo.com/q/hp?s=SNHY...f=2008&g=v&y=0

Sorry, there is nothing we can do about.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 01-10-2008, 12:46 PM   #4
wd2trade
Junior Member
 
Join Date: Nov 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
Unfortunately YAHOO's data is inconsistent regrading NVDA: no splits nor dividends reported as request
Thanks for the quick response on this, Dierk.

After seeing your query, I realized this is the same problem I ran into doing custom data grabs. I used the same query you are using, and I would not get any split data for stocks without dividends (i.e. I would get neither dividend nor split data, as is the case here).

I was able to fix it by using a "monthly price" instead of "dividend only" yahoo query:

http://finance.yahoo.com/q/hp?s=NVDA...f=2008&g=m&y=0

This gets all dividends and splits, but also includes monthly price data which I ignore.

Is there any possibility of using this this query in NinjaTrader so I can download the data?

Thanks again,
Bill
wd2trade is offline  
Reply With Quote
Old 01-10-2008, 12:49 PM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> Is there any possibility of using this this query in NinjaTrader so I can download the data?

Unfortunately not. We'll look into to see what we could get done with one of the next beta/releases.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 01-15-2008, 07:02 AM   #6
NinjaTrader_Christian
NinjaTrader Development
 
NinjaTrader_Christian's Avatar
 
Join Date: Feb 2007
Location: Bamberg, , Germany
Posts: 279
Thanks: 0
Thanked 2 times in 2 posts
Default

Hi wd2trade !

With the link you mention, i get only the splits, but no dividends for NVDA ?

Though I get the dividends for SNHY.

Kind regards,
Christian
NinjaTrader_Christian is offline  
Reply With Quote
Old 01-15-2008, 08:48 AM   #7
wd2trade
Junior Member
 
Join Date: Nov 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Christian View Post
With the link you mention, i get only the splits, but no dividends for NVDA ?
What you're getting is correct: NVDA has never paid a dividend.

I believe this is the core problem with the original query. If you select "Dividends only", and the stock pays no dividends, then it returns nothing (not even splits)

Thanks for looking at this,
Bill
wd2trade is offline  
Reply With Quote
Old 01-15-2008, 09:10 AM   #8
NinjaTrader_Christian
NinjaTrader Development
 
NinjaTrader_Christian's Avatar
 
Join Date: Feb 2007
Location: Bamberg, , Germany
Posts: 279
Thanks: 0
Thanked 2 times in 2 posts
Default

Ok, I understand.

We will discuss, and see, what we can do here.

Thanks for bringing this up !

Kind regards,
Christian
NinjaTrader_Christian is offline  
Reply With Quote
Old 01-17-2008, 03:14 AM   #9
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Thanks for your suggestion. We'll add it to the list of future considerations.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-20-2008, 01:20 AM   #10
rolfewiz
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Any word on this? This is a major flaw in the backtesting.
rolfewiz is offline  
Reply With Quote
Old 02-20-2008, 01:30 AM   #11
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Sorry, what flaw? Split data is available, just not for NVDA since there is a problem with YAHOO's data.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-20-2008, 09:16 AM   #12
wd2trade
Junior Member
 
Join Date: Nov 2007
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
Sorry, what flaw? Split data is available, just not for NVDA since there is a problem with YAHOO's data.
Whatever the cause, the data is still screwed up for any stock which has never paid a dividend, and there is an alternative query which works correctly.

Quote:
Thanks for your suggestion. We'll add it to the list of future considerations.
Are you guys still considering changing the query to get the correct data, or is that a dead end?

Thanks,
Bill
wd2trade is offline  
Reply With Quote
Old 02-20-2008, 09:22 AM   #13
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Unfortunately the alternative query does not work, since there have been other limitations which rendered it unusable (don't recall which ones though).
NinjaTrader_Dierk is offline  
Reply With Quote
Old 02-20-2008, 12:02 PM   #14
rolfewiz
Junior Member
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Uh, the flaw that everyone on this thread is talking about. This is not a trivial problem. There are many equities with this problem (NIHD is another one). You can't run a backtest on a basket of stocks without weeding these out first else the missing split info will corrupt your results dramatically.

This is not a problem with Yahoo, it's a misassumption in the query Ninjatrader uses. Yahoo does provide the split data. The problem is that right now, the user (ie me) is completely helpless as far as I can see. There's no way I can remedy this problem myself. There's no workaround. Opentick provides it also. Why not allow split data from Opentick? I can't even add the splits manually.

You can get the splits from here:
http://finance.yahoo.com/q/bc?t=3m&l...=&a=&c=&s=NVDA

And here is the code in C++ to parse the splits from the HTML. I did my best to preserve the code formatting:


Code:
struct Split
{
  time_t time;
  unsigned int from;
  unsigned int to;
};
 
vector<Split> *DataManager_Yahoo::parseSplitDataFromHTML( string filepath )
{
  static vector<Split> data;
 
  data.clear();
 
  FileBuf f;
  if( !f.load(filepath) )
  {
    return NULL;
  }
 
  //looking for this:
  //<center>Splits:none</center>
  //or this:
  //<center>Splits:<nobr>02-Sep-97 [3:2]</nobr>, <nobr>03-Aug-98 [2:1]</nobr>, <nobr>08-Feb-99 [2:1]</nobr>, <nobr>14-Feb-00 [2:1]</nobr>, <nobr>12-May-04 [2:1]</nobr></center>
 
  string s(f.buf, f.size);
  size_t start = s.find("<center>Splits:");
  s = s.substr(start + 15);
  size_t end = s.find("</center>");
  s = s.substr(0, end+1);
 
  if( s.find("none") != s.npos )
  {
    return &data;
  }
 
  while( s.find("<nobr>") != s.npos )
  {
    s.replace(s.find("<nobr>"), 6, "");
  }
  while( s.find("</nobr>") != s.npos )
  {
    s.replace(s.find("</nobr>"), 7, "");
  }
  while( s.find(",") != s.npos )
  {
    s.replace(s.find(","), 1, "");
  }
  while( s.find("-") != s.npos )
  {
    s.replace(s.find("-"), 1, " ");
  }
  while( s.find("[") != s.npos )
  {
    s.replace(s.find("["), 1, "");
  }
  while( s.find(":") != s.npos )
  {
    s.replace(s.find(":"), 1, " ");
  }
 
  //do a string.find and divide the result by 3 to get the month number.
  string months = "000JanFebMarAprMayJunJulAugSepOctNovDec";
 
  while( s.find(']') != s.npos )
  {
    SYSTEMTIME t;
    memset(&t, 0, sizeof(SYSTEMTIME));
    string month;
    Split split;
 
    strstream stream((char*)s.c_str(), s.size(), ios_base::out);
 
    stream >> t.wDay >> month  >> t.wYear >> split.to >> split.from;
 
    if( t.wYear > 50 ) t.wYear += 1900;
    else t.wYear += 2000;
 
    t.wMonth = months.find(month) / 3;
 
    split.time = systemTimeToTime_t(t);
    split.time -= 8 * 60 * 60;
 
    data.push_back(split);
 
    size_t n = s.find(']');
    s = s.substr(n+2);
  }
 
  return &data;
}
 
time_t systemTimeToTime_t(SYSTEMTIME st)
{
  tm t;
  memset(&t, 0, sizeof(tm));
  t.tm_mon = st.wMonth-1;
  t.tm_mday = st.wDay;
  t.tm_year = st.wYear - 1900;
 
  time_t ret = mktime(&t);
  return ret;
}
rolfewiz is offline  
Reply With Quote
Old 02-20-2008, 12:05 PM   #15
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Thanks for your suggestion. We'll add it to the list of future considerations.
NinjaTrader_Dierk 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
Is Yahoo data split adjusted? bmaltz Charting 14 08-31-2010 12:30 PM
Displaying daily and weekly data from yahoo? mazachan Historical NinjaTrader 6.5 Beta Threads 2 11-30-2007 12:51 PM
Minute historical data not split adjusted? Pete S Historical NinjaTrader 6.5 Beta Threads 7 11-12-2007 04:15 PM
Backfill data in Daily chart (July/August data missing) RK_trader Charting 4 09-09-2007 10:52 PM
edit yahoo data to fix a bad quote bmaltz Charting 1 04-28-2007 02:47 AM


All times are GMT -6. The time now is 06:15 PM.