trungvothanh / bett

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

Second e2e test #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As a market analyst I want to run market simulation for a given market
events and simple trader implementation.

Market impleementation:
- if(priceToBack between 2 and 4 then place bet (size: 5 price: priceToBack,
betType: back)
- if(numOfBetsOnRunner>0 and totalToBack<5) then place bet (size: 5 price:
priceToBack, betType: back)

[MARKET DATA FILE]
{"eventType":"CREATE_MARKET",
 "marketId":1, 
 "marketName":"Match Odds",
 "eventName":"Man Utd vs Arsenal", 
 "numOfWinners":1, 
 "marketTime":
 "2010-04-15 14:00:00", 
 "selections": [{"selectionId":11,
               "selectionName":"Man Utd"},
               {"selectionId":12, 
               "selectionName":"Arsenal"}]
}

{"eventType":"PLACE_BET",
 "userId":123
 "betSize": 10
 "betPrice": 3
 "betType": L
 "marketId": 1
 "selectionId": 11
}

{"eventType":"CANCEL_BET",
 "userId":123
 "betId": 1234
}

plus simular data for 2 more markets
[END OF MARKET DATA FILE]

So that I can analyze market trader.

As proven by expected profit report printed to the output screen:

[BEGINNING Of THE OUTPUT]

Simulation is started.
Simulation progress: 1% 2% 3% 4% 5% 6%
.......................................................
................................................................................
.................................
..................................100%
Simulation is finished in 0 sec.

Expected profit report for trader com.dk.bettingai.trader.SimpleTraderImpl:

Man Utd vs Arsenal: Match Odds expProfit=? expAggrProfit=?  mBets=7 uBets=4
Market 2...
Market 3...
--------------------------------------------------------------------------------
-----
TotalExpectedProfit=? TotalMatchedBets=15 TotalUnmachedBets=9

[END Of THE OUTPUT]

? - Depends on the market expected profit implementation. 

Original issue reported on code.google.com by daniel.k...@gmail.com on 19 Apr 2010 at 2:52

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 19 Apr 2010 at 3:12

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 15 Jun 2010 at 6:15

GoogleCodeExporter commented 9 years ago

Original comment by daniel.k...@gmail.com on 15 Jun 2010 at 6:15