Grouping Dataset

Overview



For many types of analysis, the data needs to be separated out by asset. That is, if the trading strategy involves looking at each asset separately (as is typically done in technical analysis), then the dataset need to be split by asset id, or ticker.

Grouping a Split Formatted Dataset






let prices = [
	{date:'2000-01-01', close:100, id:'IBM'},
	{date:'2000-01-02', close:101, id:'IBM'},
	{date:'2000-01-03', close:100, id:'IBM'},
	{date:'2000-01-01', close:145, id:'MSFT'},
	{date:'2000-01-02', close:144, id:'MSFT'},
  ];
					


Grouping a Merged Format Dataset






let prices = [
	{date:'2000-01-01', IBM:100, MSFT:145},
	{date:'2000-01-02', IBM:101, MSFT:144},
  ];
					


Contents