Forum Article

How to cancel all unmatched orders on the market/selection by bot?

Hi!

I need some help.

Heh... It looks like an easy task but I can't figure out how to do that... I need to cancel all unmatched orders on the market/selection.

Also, I've got another question. How to place orders at all selections in the market at once? For example, there are 25 selections(Horse Race) and I want to lay at 1.1 on every selection. I see there's a bot named "Place Bet" but it can only place bets on specific selection so does it mean that I need to make 25 bots for that task?

It would be nice if there was an option that I can tick and make the bot to place the order at all selections at the market.

Any help would be appreciated.

Thanks.


Updated by Stefan:

Here is the video preview of your bot trigger. It offers two parameters LayOdds and LayStake, by default are set to 10.0 @ 1.1 The offset bet as you call it, in bfexplorer terminology Hedge bet is managed by action bot entered by parameter BotName. This approach allows to setup different types of bots for closing a bet position on a selection.

It was not required but depending on the lay odds you enter it could happen that at one moment can be matched lay bets on more than one selection; the bot trigger manages such situations as well.




Download “Horse Racing Trade First Favourite Bot Trigger” script if you want to test it or build your own script from it.

  • Add Your Comment

    +

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

Comments ( 89 )


  • Ilya Nikol
    20.9.2015 20:19:40

     

    Once more, here's what I need to do:

     

    1) Place "Lay" order on all selections.

     

    2) If any of the placed Lay orders is matched then place the "offset" Back order.

     

    3) Cancel all other unmatched Lay orders.

     

    As I said I figured out how to make 1) and 2) but I can't figure out how to make 3)

     

  • Stefan
    20.9.2015 20:40:56

    I think you already learned what bfexplorer bots are about, the wrapped based functionality which can be easy setup (if people had been reading frecking bot descriptions nobody is actually reading, what you can see here on forum as well) and reused like in lego blocks.


    Any bfexplorer bot implements some basic functionally, and all bots were made to be used in certain bot betting/trading scenarios.


    Well, of course I can see some usability in new bot functionality building block/s, like what you need, cancel bets and execute some other bot, but I do not think that actual general usage would be so simple, therefore for now I would prefer what I suggested, to use Execute Trigger Bot with custom built bot trigger for your trading scenario.


    Please, test if on your computer you are able to run bot triggers, read this article:


    http://bfexplorer.net/Community/BlogContent/113


    Bfexplorer has just couple users, and those willing to test something are even less, 2 or 3 users. Miro is disqualified as a tester because he installed Visual Studio, so he is able to run bot triggers, from source code and from built assembly as I can do. Two other users run Windows 7, and for now I did not identify a problem, it seems to be just some problem of missing assemblies, or referenced assemblies wich are in Windows 7 located on different folders.


    I will be online tomorrow, so if you are willing to help me solve this Bot Trigger compilation problem then send me teamviewer access code, or other remote desktop access to your computer, if you have got similar problems to run bot trigger.


    I will program custom bot trigger for you later tomorrow.


    Your trading scenario could have some potential on some racing where two or three favorites fight to win. You assume that the first leader will be beaten; therefore you need to cancel all other unmatched bets. You really should test in practice mode on some race types only, I cannot believe you will execute profitable trade on each race, but as an example for a bot trigger this strategy of yours is good one.

  • Ilya Nikol
    20.9.2015 22:20:04

     

    Stefan, I’ve tried to run BackCorrectScore00LayDrawTrigger.fs and got this error:

    [img]http://s15.postimg.org/t4da8awcr/error.png[/img]

     

  • Ilya Nikol
    20.9.2015 22:22:49

     

    Here's the screenshot of the log with the errors - http://s15.postimg.org/t4da8awcr/error.png

     

  • Stefan
    21.9.2015 11:19:35

    There are two options how to execute bot trigger. You tested bot trigger execution from source code, and once again you confirmed that compilation ends with error because on your system there are missing assemblies or are just located in different folder. I can live with that because installing Visual Studio solves these problems, what Miro already tested.


    These issues seems to be out of Miro’s interest because he did not comment this issue, actually he can shed more light on it because maybe he tested bot trigger execution before installing Visual Studio.


    The second option is to execute bot trigger from complied assembly, you actually have both files when you downloaded zip file.

  • Ilya Nikol
    21.9.2015 13:16:34

     

    For example, I tried to search for mscorlib.dll and System.dll and found them in these locations:

    mscorlib.dll - C:\Windows\Microsoft.NET\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089
                   C:\Windows\Microsoft.NET\Framework\v4.0.30319
                   C:\Windows\Microsoft.NET\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089
                   C:\Windows\Microsoft.NET\Framework64\v4.0.30319 
                   C:\Windows\Installer\$PatchCache$\Managed\5D136A49A03B8DD36BC511710CD97AE3\4.6.81 
                   C:\Windows\Microsoft.NET\Framework\v2.0.50727

     

     


    System.dll - C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089
                 C:\Windows\Microsoft.NET\Framework\v4.0.30319
                 C:\Windows\Microsoft.NET\Framework64\v4.0.30319
                 C:\Windows\winsxs\msil_system_b77a5c561934e089_6.1.7601.17966_none_aef0fb4c1897386e
                 C:\Windows\winsxs\amd64_netfx-system_b03f5f7f11d50a3a_6.1.7601.21890_none_a86a53a8176f75e6
                 C:\Windows\winsxs\amd64_netfx-system_b03f5f7f11d50a3a_6.1.7601.17514_none_bf2f9d3ffdcfb10a

     

    Yes, I have BackCorrectScore00LayDrawTrigger.dll. Where shoudl I put it?

  • Mir.
    21.9.2015 15:16:16

    Soon I will reinstall to a clean Win 10.

    I will try again.

     

    ------------

    Now I have got folder with a scripts on the separate hard drive, not in Docu folder like you...

  • Stefan
    21.9.2015 15:23:41

    Miro does not waste your time on reinstalling Windows. Eduardo has clean install of Windows 10, so I will try to test it on his computer.


    Actually no one of you will manage to work with bot trigger source code, so the other alternative with bot trigger assembly is my priority for now, I just need to test it, it works fine on my computer.

  • Stefan
    21.9.2015 18:40:31

    So the problem with using bot trigger assembly (.dll file), was that anything you download from internet to your computer is blocked. You must first unblock such file by using file properties dialog.

     

    http://www.tenforums.com/tutorials/5357-unblock-file-windows-10-a.html

  • Ilya Nikol
    21.9.2015 19:17:37

    Stefan, I unblocked BackCorrectScore00LayDrawTrigger.fs and BackCorrectScore00LayDrawTrigger.dll but still got the same error.

    Here's the screenshot of the log - http://s16.postimg.org/fymphin51/error1.png