DrPaulBrewer / single-market-robot-simulator-viz-plotly

middleware for generating charts with plotly from single-market-robot-simulator simulation logs
Other
1 stars 0 forks source link

average profit charts show a single line of zero profit on single period simulations #8

Closed DrPaulBrewer closed 4 years ago

DrPaulBrewer commented 4 years ago

Charts that show price distributions, and bid/ask/trade time series appear to work properly.

This seems to be an issue solely with the profit comparison "smart" scatterplot charts.

Charts with a multi-period data source are working, but it is unknown whether the reported averages are missing a period of data.

DrPaulBrewer commented 4 years ago

This line looks suspicious:

            profitData.forEach((row,k)=>{ if(k>1) sum += toNumberOrZero(row[col]); });

The 0-th row is the header.

The 1st row is the first row of data.

But if(k>1) starts with k=2. Instead we need to start with k=1;

DrPaulBrewer commented 4 years ago

... if (k>0) sum+= ... passes test