Taketrung / betting-ai

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

Market simulation for PLACE_BET event and simple trader implementation. #8

Closed GoogleCodeExporter closed 9 years ago

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

Market impleementation:
if(priceToBack between 2 and 4 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
}

[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=1 uBets=0
--------------------------------------------------------------------------------
-----
TotalExpectedProfit=0 TotalMatchedBets=? TotalUnmachedBets=?

[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 11:30

GoogleCodeExporter commented 9 years ago
Technical notes:
- Implement MarketEventProcessor to handle PLACE_BET event.
- Implement betex to hande placeBet.
- Implement trader: if(priceToBack between 2 and 4 then place bet (size: 5 
price:
priceToBack,
betType: back)
- Implemented ExpectedProfitCalculator to handle bets and probabilities.

Original comment by daniel.k...@gmail.com on 19 Apr 2010 at 11:33

GoogleCodeExporter commented 9 years ago

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