I am trying to write a system that uses the EXTRA PLACE prices (if they exist).
In the old system it was pretty easy with a LINQ statement and function to check the market type (5TBP, 4TBP etc). However when I try and pass anything into the market I don't get a response even though I have been checking online to ensure there is a place market and extra place market (lower OR higher)
The code I am using is below
DEBUG FROM THAT.....
IN SetUpHorseRacingMarketExtra inplayEnabled = False;
SaveGlobalMarkets - Market Info;
CALL SaveGlobalMarkets;
EndPoint = https://api.betfair.com/exchange/betting/json-rpc/v1/;
Calling: SportsAPING/v1.0/listMarketCatalogue With args: {"filter":{"eventTypeIds":["7"],"turnInPlayEnabled":false,"marketCountries":["GB"],"marketTypeCodes":["OTHER_PLACE","4TBP","5TBP","PLACE_OTHER"],"marketStartTime":{"from":"2016-10-17T17:52:37.9214385+01:00","to":"2016-10-18T00:00:00+01:00"}},"marketProjection":["COMPETITION","RUNNER_DESCRIPTION","EVENT","EVENT_ TYPE","MARKET_START_TIME","RUNNER_METADATA"],"sort":"FIRST_TO_START","maxResults":"200","local e":null};
try and get response;
Got Response: {"jsonrpc":"2.0","result":[],"id":1};
We have 0 markets to loop through;
Is there a special format for extra place markets I need to use?
How do I return the prices, market Id and information for a runner in a 4TBP market where is it's the extra market in a standard 8 horse race?
Thanks
Rob
In the old system it was pretty easy with a LINQ statement and function to check the market type (5TBP, 4TBP etc). However when I try and pass anything into the market I don't get a response even though I have been checking online to ensure there is a place market and extra place market (lower OR higher)
The code I am using is below
Code:
public void SetUpHorseRacingMarketExtra(bool inplayEnabled)
{
this.HelperLib.LogMsg("IN SetUpHorseRacingMarketExtra inplayEnabled = " + inplayEnabled.ToString(), "MEDIUM");
var time = new TimeRange();
time.From = DateTime.Now;
time.To = DateTime.Today.AddDays(1);
MarketFilter marketFilter = new MarketFilter();
// only need horse racing
ISet<string> EventTypeIDs = new HashSet<string>();
EventTypeIDs.Add("7");
marketFilter.EventTypeIds = EventTypeIDs;
marketFilter.MarketStartTime = time;
marketFilter.MarketCountries = new HashSet<string>();
marketFilter.MarketCountries.Add("GB");
// Add in all the place markets that are shown on the website - as I cannot find any other definition to use?
marketFilter.MarketTypeCodes = new HashSet<String>() { "OTHER_PLACE", "4TBP", "5TBP", "PLACE_OTHER" };
marketFilter.TurnInPlayEnabled = inplayEnabled;
ISet<MarketProjection> marketProjections = new HashSet<MarketProjection>();
marketProjections.Add(MarketProjection.COMPETITION);
marketProjections.Add(MarketProjection.RUNNER_DESCRIPTION);
marketProjections.Add(MarketProjection.COMPETITION);
marketProjections.Add(MarketProjection.EVENT);
marketProjections.Add(MarketProjection.EVENT_TYPE);
marketProjections.Add(MarketProjection.MARKET_START_TIME);
marketProjections.Add(MarketProjection.RUNNER_METADATA);
this.HelperLib.LogMsg("SaveGlobalMarkets - Market Info", "HIGH");
this.HelperLib.LogMsg("CALL SaveGlobalMarkets", "HIGH");
// add these markets to our global list of markets
//this.SaveGlobalMarkets(marketFilter, marketProjections, inplayEnabled);
var marketSort = MarketSort.FIRST_TO_START;
var maxResults = "200";
var marketCatalogues = BetfairAPI.Client.listMarketCatalogue(marketFilter, marketProjections, marketSort, maxResults);
this.HelperLib.LogMsg("We have " + marketCatalogues.Count.ToString() + " markets to loop through", "MEDIUM");
for (int i = 0; i < marketCatalogues.Count; i++)
{
MarketCatalogue marketCatalogue = marketCatalogues[i];
string course = "";
string country = "";
this.HelperLib.LogMsg("MarketID: " + marketCatalogue.MarketId, "MEDIUM");
this.HelperLib.LogMsg("Market Name: " + marketCatalogue.MarketName, "MEDIUM");
this.HelperLib.LogMsg("Market StartTime: " + marketCatalogue.MarketStartTime, "MEDIUM");
this.HelperLib.LogMsg("isMarketDataDelayed: " + marketCatalogue.IsMarketDataDelayed, "MEDIUM");
this.HelperLib.LogMsg("Description: " + marketCatalogue.Description, "MEDIUM");
this.HelperLib.LogMsg("EventType: " + marketCatalogue.EventType, "MEDIUM");
this.HelperLib.LogMsg("Event: " + marketCatalogue.Event, "MEDIUM");
this.HelperLib.LogMsg("Competition: " + marketCatalogue.Competition, "MEDIUM");
course = marketCatalogue.Event.Venue;
country = marketCatalogue.Event.CountryCode;
this.HelperLib.LogMsg("Get race info for " + marketCatalogue.MarketName.ToString() + " - " + course + " - " + country, "MEDIUM");
// ensure we get the right race info so we can save it all to our table in one go
RaceInfo raceInfo = this.GetRaceInfo(marketCatalogue.MarketName, Convert.ToDateTime(marketCatalogue.MarketStartTime), course, country);
this.HelperLib.LogMsg("RacePK for market is " + raceInfo.RacePK.ToString(), "HIGH");
if (raceInfo.RacePK > 0)
{
this.HelperLib.LogMsg("Add to this.AllMarkets", "HIGH");
this.HelperLib.LogMsg("Add to Market obj", "HIGH");
this.HelperLib.LogMsg("RacePK = " + raceInfo.RacePK.ToString(), "HIGH");
this.HelperLib.LogMsg("MarketID = " + this.HelperLib.FormatMarketID(marketCatalogue.MarketId).ToString(), "HIGH");
this.HelperLib.LogMsg("MarketType = " + raceInfo.MarketType, "HIGH");
this.HelperLib.LogMsg("Racedatetime = " + Convert.ToDateTime(marketCatalogue.MarketStartTime).ToString(), "HIGH");
this.HelperLib.LogMsg("InplayEnabled = " + inplayEnabled.ToString(), "HIGH");
this.HelperLib.LogMsg("Added ok", "HIGH");
}
}
}
DEBUG FROM THAT.....
IN SetUpHorseRacingMarketExtra inplayEnabled = False;
SaveGlobalMarkets - Market Info;
CALL SaveGlobalMarkets;
EndPoint = https://api.betfair.com/exchange/betting/json-rpc/v1/;
Calling: SportsAPING/v1.0/listMarketCatalogue With args: {"filter":{"eventTypeIds":["7"],"turnInPlayEnabled":false,"marketCountries":["GB"],"marketTypeCodes":["OTHER_PLACE","4TBP","5TBP","PLACE_OTHER"],"marketStartTime":{"from":"2016-10-17T17:52:37.9214385+01:00","to":"2016-10-18T00:00:00+01:00"}},"marketProjection":["COMPETITION","RUNNER_DESCRIPTION","EVENT","EVENT_ TYPE","MARKET_START_TIME","RUNNER_METADATA"],"sort":"FIRST_TO_START","maxResults":"200","local e":null};
try and get response;
Got Response: {"jsonrpc":"2.0","result":[],"id":1};
We have 0 markets to loop through;
Is there a special format for extra place markets I need to use?
How do I return the prices, market Id and information for a runner in a 4TBP market where is it's the extra market in a standard 8 horse race?
Thanks
Rob


Comment