Forum Article

Help with place order

Just trying to place an order, but my code gets stuck, and the task never completes. What am I doing wrong?

 

        public async Task ExecuteMyTest()

        {

            var result = await _bfexplorerService.BetfairServiceProvider.BettingOperations.PlaceOrder(

               _market.Id,

               _market.Selections[0].Identity.Id,

               Side.LAY,

               1,

               _market.Selections[0].ToLay.BestPrice.Price,

               FSharpOption<double>.None,

               FSharpOption<BeloSoft.Betfair.API.Models.PersistenceType>.Some(BeloSoft.Betfair.API.Models.PersistenceType.LAPSE),

               FSharpOption<long>.None,

               FSharpOption<string>.None,

               FSharpOption<bool>.Some(true)).ExecuteAsyncTask();

        }

 

        public override void Execute()

        {

            var task = ExecuteMyTest();

            Task.WaitAll(task);

            Status = BotStatus.ExecutionEnded;

        }

 

  • Add Your Comment

    +

    Please login to your bfexplorer account, if you want to add a comment to this article.

Comments ( 2 )


  • adska
    17.8.2024 14:04:57

    It is same with all commands 

  • Betfair Bot
    18.8.2024 13:42:56

    Why are you trying to over complicated your bet placing when you can use built-in bet strategy “Place Bet”, to setup your bet and execute it.

    If you are trying to build a strategy then simplest way for you is start coding BotTrigger code, there is a lot of examples here on forum and a lot of code on my github page.