Limit On Close Bets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • monkeymagix
    Junior Member
    • Jul 2010
    • 105

    #1

    Limit On Close Bets

    Hi

    It might just be that it's because I've just come back from the Pub for lunch or the pain killers I am taking for my Kidney Stones but my head is slightly muddled.

    I have a BOT (using the old SOAP API C# if anyone has an example of a way to rewrite methods like placebet, getmarketId, cancel, withdraw etc etc in the new JSON version then please let me know as I need to rewrite my code at some stage)

    Anyway I have some bets that I only want to place if they have a price of 3.0 or above at race off time.

    I am getting my head confused around the settings as I set my bet up to have a persistence type of SP (which I need to change) and then place it on the exchange with a desired price of 3.0 or 3.5 or whatever.

    If its not matched then it takes the SP which could obviously be below 3.0 e.g 1.10 or 2.40 or whatever - which I don't want. I only want the bet taken if the price is 3.0 or above.

    So my current code is (simplified)


    Code:
    BFUK.PlaceBets Bet = new BFUK.PlaceBets();
    
    Bet.betCategoryType = BFUK.BetCategoryTypeEnum.E; // use exchange
    Bet.betPersistenceType = BFUK.BetPersistenceTypeEnum.SP; // convert to SP if not matched before race
    Bet.betType = BFUK.BetTypeEnum.B; // back
    Bets.price = 3.00; //  price I want
    Which I take is wrong as it would mean a bet I wanted to place at 3.50 would be converted to SP and placed even if the SP price was 1.05??

    What would the settings be if I wanted to use limit on close e.g only convert the bet to an SP bet IF the SP price was 3.00 OR above at in-play.

    Would it be this?

    Code:
    BFUK.PlaceBets Bet = new BFUK.PlaceBets();
    
    Bet.betCategoryType = BFUK.BetCategoryTypeEnum.L; // limit on close
    Bet.betPersistenceType = BFUK.BetPersistenceTypeEnum.NONE; // already SP bet so no need to persist ??
    Bet.betType = BFUK.BetTypeEnum.B; // back
    Bets.price = 3.00; //  price I want

    Which means that because the Category Type is NOT the exchange e.g L (limit on close)

    and betPersistenceType = NONE (as its already an SP bet)

    then the bet will only get converted to an SP bet IF the price was 3.00 or above at in-play?

    If not it would get LAPSED.

    Can someone just confirm this so I am clear in my head I am doing the right thing please.

    Also any .NET C# versions using JSON would be great so I can get a working API class up and running using the new API.

    Thanks
  • monkeymagix
    Junior Member
    • Jul 2010
    • 105

    #2
    I am getting errors with Limit on close

    After the code example I wrote the other day I am now getting INTERNAL_ERROR
    errors when trying to place the bet (when the Response header gets checked) e.g

    Code:
    CheckHeader(PlaceBetsResp.header);
    which calls this function that checks the header for any errors and returns the INTERNAL_ERROR message.

    Code:
    public void CheckHeader(BFUK.APIResponseHeader Header)
    { 
    
        APIHeaderGL.sessionToken = Header.sessionToken;
    
        // set flag so other calls know if we had an issue
        this.ThrottleLimitError = false;
    
        // if we have broken the API request limit wait until the next minute when it gets reset
        if (Header.errorCode.ToString() == "EXCEEDED_THROTTLE")
        {
    	
    	// kill ourself as using a thread to wait until the next minute seems to destroy all our objects and then
    	// we end up doing stupid things like cancelling markets that are still active. I don't know what is causing this
    	// but it seems sensible to just DIE and then let the timer start a new job in X seconds or so and carry on with good object
    	// references etc
    	this.ThrottleLimitError = true;
    	
    	// wait X seconds
    	this.BeatThrottleLimit();
    	
    	// kill all our objects - which might raise an error up to the top
    	this.Dispose();
    
    	// now set ourselves back up by re-creating the main API objects
    	this.Setup();
    
    	// point our API object back to our session
    	this.SetSession();
        }
        else if (Header.errorCode.ToString() == "INTERNAL_ERROR")
        {
    	// log my error to the log file
    	HelperLib.LogMsg("Internal Error");
        }
    }
    Therefore I am guessing the code I posted yesterday isn't working?

    Does anybody know what is wrong?

    Comment

    Working...
    X