Example of code to Play a Sound when a certain odd is reached.

Hello,

Could you please post a simple example of code that just do the following (for example): Play a sound when Back for runner 0 is 1.45 or less.

Just that.

Thank you,

Regards.

Comments (14)

  1. StefanBelo Says:
    Monday, April 18, 2011

    Marcos, Bfexplorer PRO 2 have a new bot executor and I have added a bot called: Selection notifier.

  2. Mir. Says:
    Monday, April 18, 2011

    Wow! Nice! ;)

  3. msr Says:
    Tuesday, April 19, 2011

    I´ve tried it but it would be great that:

    1.You can choose which sound to Play. I´ve tried to set a path to a sound but it doesn´t play it. It just uses the "Say".

    2.You can choose Betype. Play a sound when Back or when Lay reaches an odd (you can choose whether you want to play a sound when Back is <1.40 or Lay).

    Thanks.

  4. StefanBelo Says:
    Tuesday, April 19, 2011

    For simplicity this bot evaluates average odds in offer, so I think there is no need for choosing back or lay odds to be checked.

    I will add possibility to play a sound.

  5. msr Says:
    Tuesday, April 19, 2011

    Great for the playing a sound.

    And, with "bot evaluates average odds in offer" do you mean that the bot takes the Back and the Lay for the same selection an divide by 2?.

    Example for selection 0 Back is 1.34 and Lay is 1.54 so the average odd is 1.44?. Is that what you mean?. And what will happen in markets where there is no Back or Lay at certain moments (low liquidity)?. You know that some of us use Bfexplorer for markets with low liquidity. Will it take just the Back or the Lay?. In the example above, will it use just the Back 1.34 and play a sound with it or will it calculate 1.34/2=1.17?.

    I think it would be better if you could chose the Back or the Lay or put an option to play a sound if the Back is <1.45 and if there is no Back but there is a Lay, play a sound if the Lay is <1.45 and viceversa: if there is a Lay (and no Back) then play a sound when the Lay is below a certain odd.

  6. StefanBelo Says:
    Tuesday, April 19, 2011

    Ok, so I will add option to select which odds should be monitored. Once the preset odds is detected, the bot ends its execution.

  7. msr Says:
    Tuesday, April 19, 2011

    Great. Thanks.

  8. StefanBelo Says:
    Wednesday, April 20, 2011

    Marcos, I have just released new version of Bfexplorer PRO 2 adding required features to Selection notifier bot.

  9. msr Says:
    Wednesday, April 20, 2011

    Thank you.

    It works well except one thing. If for example you run the Selection Notifier bot in 2 selections, and in one of the selections the criteria are met and the sound is played, then the bot in the other selection is also stopped. I think it should be better to just stop the bot in the selection you´ve runned and not in all the market. Because maybe you need a bot to play a sound in Selection A (when for example Back is <1.45, but also you need a different sound to play a sound in Selection B (when for example Back is <1,30), but I´ve seen that if the bot is stopped in Selection A it also stops the bot of Selection B. It will better to just stop the bot for that selection.

    BTW I have seen that in Bfexplorer2 you don´t have the F4, F5, F6 keyboard option added for the:

    Close position, Close position by Dutching, Close position for selection.

    It was really useful and fast to use the F4, F5, F6. If you add it, please if possible put them in the same order as in Bfexplorer since in BfexplorerPRO2 you have put "Close position by Dutching" as the last one and the last one in Bfexplorer was "Close position for selection". Just to not mistake the old F4, F5, F6 with the new ones.

    Thanks.

  10. StefanBelo Says:
    Wednesday, April 20, 2011

    Well the SelectionNotifierBot is a market bot type and is not executed on a selection. You should create two bot settings and execute each of them on the market you want to be notified about price movements.

    What you maybe did was to create two bot settings and add them for concurrent execution on a selection, this could work as you intended, but if you run on the same selection other runner bot type, then previous runner bot is stopped.


Do you want to comment this article? Sign up here or login.