Announcement

Collapse
No announcement yet.

IB TWS EFS to submit orders

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

  • IB TWS EFS to submit orders

    The following EFS worked fine in 10.6 but does not work at all in 11 and I see no errors. The EFS adds 4 buttons to a chart to allow you to submit orders. I've tried emailing support but so far 3weeks no response!!!



    /************************************************** ***************
    Provided By : eSignal. (c) Copyright 2004

    Notes:

    To enable/disable the trading buttons on the chart, right-click on
    the "Endabled" or "Disabled" label just below the Buy/Sell buttons.

    This formula is written for Interactive Broker Plug-in with
    version 7.7.
    ************************************************** ***************/

    /* Generic Broker functions *****

    buyMarket(symbol, quantity [, route [, expiry]])
    buyLimit(symbol, quantity, dLimit [, route [, expiry]])
    buyStop(symbol, quantity, dStop [, route [, expiry]])
    buyStopLimit(symbol, quantity, dLimit, dStop [, route [, expiry]])

    sellMarket(symbol, quantity [, route [, expiry]])
    sellLimit(symbol, quantity, dLimit [, route [, expiry]])
    sellStop(symbol, quantity, dStop [, route [, expiry]])
    sellStopLimit(symbol, quantity, dLimit, dStop [, route [, expiry]])

    *****************************/


    function preMain() {
    setStudyTitle("IB");
    setPriceStudy(true);
    setShowCursorLabel(false);

    }



    function main() {
    var nState = getBarState();


    drawTextAbsolute(3, 30, " ",
    Color.black, Color.white,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.BOLD | Text.CENTER,
    "Arial", 63, "border");

    drawTextAbsolute(3, 93, "200" + "@URL=EFS:BuyCallBack200",
    Color.white, Color.green,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OB");

    drawTextAbsolute(3, 73, "300" + "@URL=EFS:BuyCallBack300",
    Color.white, Color.green,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OS");

    drawTextAbsolute(3, 53, "200" + "@URL=EFS:SellCallBack200",
    Color.white, Color.red,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OF");

    drawTextAbsolute(3, 33, "300" + "@URL=EFS:SellCallBack300",
    Color.white, Color.red,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OK");

    bEdit = false;
    }




    /******************
    *** Functions ****
    ******************/

    function BuyCallBack200(nButtonPressed) {

    Alert.playSound("pop.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    buyStopLimit(getSymbol(), 200, getMostRecentAsk() ,(getMostRecentAsk() + 0.03) );
    }
    }

    function BuyCallBack300(nButtonPressed) {

    Alert.playSound("pop.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    buyStopLimit(getSymbol(), 300, getMostRecentAsk() ,(getMostRecentAsk() + 0.03) );
    }

    }
    function SellCallBack200(nButtonPressed) {

    Alert.playSound("tap2.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    sellStopLimit(getSymbol(), 200, getMostRecentBid(),(getMostRecentBid() - 0.03) );
    }

    }
    function SellCallBack300(nButtonPressed) {

    Alert.playSound("tap2.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    sellStopLimit(getSymbol(), 300, getMostRecentBid(),(getMostRecentBid() - 0.03) );
    }

    }
    Simon Allen

  • #2
    Re: IB TWS EFS to submit orders

    simonallen
    In version 11 you need to press the Shift key when calling mouse functions from the chart
    Alex


    Originally posted by simonnallen
    The following EFS worked fine in 10.6 but does not work at all in 11 and I see no errors. The EFS adds 4 buttons to a chart to allow you to submit orders. I've tried emailing support but so far 3weeks no response!!!



    /************************************************** ***************
    Provided By : eSignal. (c) Copyright 2004

    Notes:

    To enable/disable the trading buttons on the chart, right-click on
    the "Endabled" or "Disabled" label just below the Buy/Sell buttons.

    This formula is written for Interactive Broker Plug-in with
    version 7.7.
    ************************************************** ***************/

    /* Generic Broker functions *****

    buyMarket(symbol, quantity [, route [, expiry]])
    buyLimit(symbol, quantity, dLimit [, route [, expiry]])
    buyStop(symbol, quantity, dStop [, route [, expiry]])
    buyStopLimit(symbol, quantity, dLimit, dStop [, route [, expiry]])

    sellMarket(symbol, quantity [, route [, expiry]])
    sellLimit(symbol, quantity, dLimit [, route [, expiry]])
    sellStop(symbol, quantity, dStop [, route [, expiry]])
    sellStopLimit(symbol, quantity, dLimit, dStop [, route [, expiry]])

    *****************************/


    function preMain() {
    setStudyTitle("IB");
    setPriceStudy(true);
    setShowCursorLabel(false);

    }



    function main() {
    var nState = getBarState();


    drawTextAbsolute(3, 30, " ",
    Color.black, Color.white,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.BOLD | Text.CENTER,
    "Arial", 63, "border");

    drawTextAbsolute(3, 93, "200" + "@URL=EFS:BuyCallBack200",
    Color.white, Color.green,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OB");

    drawTextAbsolute(3, 73, "300" + "@URL=EFS:BuyCallBack300",
    Color.white, Color.green,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OS");

    drawTextAbsolute(3, 53, "200" + "@URL=EFS:SellCallBack200",
    Color.white, Color.red,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OF");

    drawTextAbsolute(3, 33, "300" + "@URL=EFS:SellCallBack300",
    Color.white, Color.red,
    Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.CENTER,
    "Arial", 12, "OK");

    bEdit = false;
    }




    /******************
    *** Functions ****
    ******************/

    function BuyCallBack200(nButtonPressed) {

    Alert.playSound("pop.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    buyStopLimit(getSymbol(), 200, getMostRecentAsk() ,(getMostRecentAsk() + 0.03) );
    }
    }

    function BuyCallBack300(nButtonPressed) {

    Alert.playSound("pop.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    buyStopLimit(getSymbol(), 300, getMostRecentAsk() ,(getMostRecentAsk() + 0.03) );
    }

    }
    function SellCallBack200(nButtonPressed) {

    Alert.playSound("tap2.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    sellStopLimit(getSymbol(), 200, getMostRecentBid(),(getMostRecentBid() - 0.03) );
    }

    }
    function SellCallBack300(nButtonPressed) {

    Alert.playSound("tap2.wav");
    if (nButtonPressed == BUTTON_LEFT) {
    sellStopLimit(getSymbol(), 300, getMostRecentBid(),(getMostRecentBid() - 0.03) );
    }

    }

    Comment


    • #3
      Re: Re: IB TWS EFS to submit orders

      Originally posted by Alexis C. Montenegro
      simonallen
      In version 11 you need to press the Shift key when calling mouse functions from the chart
      Alex
      OK thanks that works when will they fix having to press shift key that is just so dumb
      Last edited by simonnallen; 11-28-2011, 09:10 AM.
      Simon Allen

      Comment


      • #4
        Re: Re: Re: IB TWS EFS to submit orders

        simonallen
        From the EFS KnowledgeBase article on Mouse Functions
        Starting with version 11.1 all mouse functions require the use of the Shift key when called from the chart. This change was done to avoid conflicts between EFS and chart mouse events (such as right clicking or double clicking) without compromising any backwards compatibility.
        Alex


        Originally posted by simonnallen
        OK thanks that works when will they fix having to press shift key that is just so dumb

        Comment

        Working...
        X