I’d like to create a SubMatrix or ArrayList of the below matrix (I made it smaller so it would fit) where tradeTime > sessionBegin and < sessionEnd.
DateTime tradeTime;
private DateTime sessionBegin;
private DateTime sessionEnd;
int[,] hTrades =
{
{ 2012, 11, 9, 10, 24, 1, -1, 8515 },
{ 2012, 11, 9, 10, 24, 2, -1, 8515 },
{ 2012, 11, 9, 10, 44, 3, 1, 8530 },
{ 2012, 11, 9, 10, 44, 4, 1, 8535 },
{ 2012, 11, 9, 10, 55, 5, -1, 8537 },
{ 2012, 11, 9, 10, 55, 6, -1, 8537 },
{ 2012, 11, 9, 11, 1, 7, 1, 8552 },
{ 2012, 11, 9, 11, 7, 8, 1, 8556 },
{ 2012, 11, 11, 18, 18, 1, 1, 8617 },
{ 2012, 11, 11, 18, 18, 2, 1, 8617 },
{ 2012, 11, 11, 18, 18, 3, 1, 8617 },
{ 2012, 11, 11, 18, 18, 4, 1, 8617 }
};
tradeTime = new DateTime(hTrades[i, 0], hTrades[i, 1], hTrades[i, 2],
hTrades[i, 3], hTrades[i, 4], 0);
To begin with, dealing with that 2-d array could get a little awkward. To simplify, you could group each row of that matrix into an object:
This will find the
Tradeobjects that correspond to the following trades: