private static void getStatistics(Network network, FsdParser parser, double threshold,
out int numTradesWon, out int numTradesLost, out double tradeWinRate)
{
numTradesWon = 0;
numTradesLost = 0;
int numSamples = parser.InputVectors.Length;
for (int sampleIdx = 0; sampleIdx < numSamples; sampleIdx++)
{
double[] computed = network.Compute(parser.InputVectors[sampleIdx]);
if (computed[0] > threshold && computed[1] < threshold)
{
// Netzwerk hat "Rise" errechnet
if (parser.OutputVectors[sampleIdx][0] == 1)
{
numTradesWon++;
}
else
{
numTradesLost++;
}
}
else if (computed[1] > threshold && computed[0] < threshold)
{
// Netzwerk hat "Fall" errechnet
if (parser.OutputVectors[sampleIdx][1] == 1)
{
numTradesWon++;
}
else
{
numTradesLost++;
}
}
}
tradeWinRate = (double)numTradesWon / (numTradesWon + numTradesLost);
}