Announcement

Collapse
No announcement yet.

Keyboard Shortcut - to buy & sell - MB Trading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keyboard Shortcut - to buy & sell - MB Trading

    Hi all,

    I'd like to create a keyboard shortcut to launch a limit buy or sell order to my broker.

    The code should:
    1) check the current ask price
    2) submit a limit order to by the position.

    I'd like to do this via an efs if possible,
    because eventually I'd like to do some other things
    with the shortcut like determine my position size.

    Can an efs even be launched by a keyboard shortcut?

    My broker is MB Trading and not eSignal.

    Thank you,

    John

  • #2
    Hello John,

    Executing a specific function from within an EFS can not be assigned to a keyboard short cut to the best of my knowledge. What you can do using the Attached Order Ticket is create a custom button in the order ticket designer (Trade-->Order Ticket Designer) that executes an EFS function. However, you do have to click the button to initiate the execution of the EFS function.

    The function used to get the ask price is getMostRecentAsk(). The functions used to place orders, such as buyLimit(), can be found here. The first thing you need to do is create a new formula and save it with a custom name such as, myTradeFunctions.efs. Or any name of choice. Add the following function to the file and save it.

    PHP Code:
    function test() {
        
        var 
    nAsk getMostRecentAsk();
        
        
    buyLimit(getSymbol(), 1nAsk);
        
        return;


    Then using the Order Ticket Designer, create a new order ticket template with a custom name of your choosing and set the template to point to the EFS file you create in the properties dialog.



    Then add a custom button and set it to execute the function by name that exists the formula.



    Set the action at the top of this dialog to "Execute EFS" and then enter the name of the function in the EFS Function field. I entered "test" in the example obove because that is the name of the funtion in the EFS file. Hope this helps.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X