Taketrung / betting-ai

Automatically exported from code.google.com/p/betting-ai
1 stars 1 forks source link

Simulation html report with time line chart #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As a trader
I want to get html simulation report with time line chart.
So that I can analyse trading strategy

Original issue reported on code.google.com by daniel.k...@gmail.com on 28 Aug 2010 at 6:22

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 28 Aug 2010 at 6:22

GoogleCodeExporter commented 9 years ago
After market simulation is finished, html report is generated. It contains one 
time line graph for each analysed market. Time line graph may contain up to 100 
time series (limited due to performance reasons). Which time series are 
displayed depends on trader implementation, that can use API to add data to a 
graph. For instance the trader below is adding best toBack/toLay prices to a 
graph:

def execute(ctx: ITraderContext) = {
  for(runner <- ctx.runners) {
    val bestPrices = ctx.getBestPrices(runner.runnerId)
    ctx.addChartData("toBack",bestPrices._1)
    ctx.addChartData("toLay",bestPrices._2)
  }
}

The time stamp for chart data is the same as time stamp of historical market 
state that the trader implementation is executed for. For example, if trader is 
analysing market data for one minute with a collection interval 1 sec, then the 
graph for the trader above will contain 60 samples for both toBack/toLay series.

There is no limitation on what kind of data can be added to a chart. For 
instance the example below will add a constance line to a chart:

tx.addChartData("fixedLine",50)

Original comment by daniel.k...@gmail.com on 28 Aug 2010 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 28 Aug 2010 at 6:57

GoogleCodeExporter commented 9 years ago
TODO:
- Create empty html report and save it to current directory - 1
- Add one empty time line graph for each analysed market to html report - 3
- Add addChartData(label:String,value:Double) to Trader context - 1
- Update time line graph with chart data - 3

Original comment by daniel.k...@gmail.com on 28 Aug 2010 at 7:01

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 4 Sep 2010 at 8:07