Announcement

Collapse
No announcement yet.

Trade functions return null OrderID

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

  • Trade functions return null OrderID

    Hi: Apologies for starting a new thread on null OrderID. I could not find a solution to the problem below on the other EFS-ATS posts.

    Trade functions return OrderID as null. Following is a code section I am trying. Can someone please tell me what I am doing wrong? EFS ATS is checked active at the bottom right as well as chart top bar.


    code fragment
    {....
    var vOrderID= Trade.buyLimit(nEntryPrice, sSymbol, nStckQty);
    ...
    ...
    fLog.writeln("OrderID:\t" + vOrderID);
    ....
    }

    Result:
    ...
    OrderID: null
    ...

  • #2
    Typically when I cannot find a fault in the code for submitting an order, I check for other environmental causes:

    1. Not having clicked on the EFS button in the bottom toolbar.
    2. Not having clicked on the EFS button in the chart.
    3. Not having a valid working connection to the broker account or simulated trading account.
    4. Not having valid default settings/options for the specific symbol and exchange under Broker Manager.

    I do not know if you checked these conditions. Usually one of these conditions was not met when my code failed to submit an order.

    Comment


    • #3
      Hello asrajan,

      If you are sure that both EFS-AT switches are activated, please also make sure that the script is executed on real-time data. On historical data the trade functions return 'null'.
      If you're using real time data and the issue persist, then please provide us with some EFS example that illustrates the problem so we can try and duplicate the issue on our side.

      Thank you,
      AveryH
      eSignal Support

      Comment


      • #4
        Hello Avery:
        Thank you for the clue on Trade functions returning 'null' on historical data. I have the trade function returning valid order ID. I had to implement a handler with a "@URL=EFS:buyHandler" in the drawTextRelative(..) on the chart.

        However each BUY or sell call opens the eSignal Paper Trader simulation BUY/Sell dialog, requiring the BUY or SELL button to be clicked.

        Is there a way to make the BUY or SELL automatic i.e. without the need to click buy/sell button) on calling for e.g. sOrderID= Trade.buyMarket(sSymbol, nStckQty);?

        Hoping someone can provide some help/pointers

        Thanks

        Comment


        • #5
          Hello Asrajan,

          I am assuming you are referring to the 'Order Ticket' that appears on every efs-order.
          To disable this confirmation dialog you need to go: Main Menu -> Trade -> Trade Settings and uncheck 'Confirm EFS Orders'.


          AveryH
          eSignal Support

          Originally posted by asrajan View Post
          Hello Avery:
          Thank you for the clue on Trade functions returning 'null' on historical data. I have the trade function returning valid order ID. I had to implement a handler with a "@URL=EFS:buyHandler" in the drawTextRelative(..) on the chart.

          However each BUY or sell call opens the eSignal Paper Trader simulation BUY/Sell dialog, requiring the BUY or SELL button to be clicked.

          Is there a way to make the BUY or SELL automatic i.e. without the need to click buy/sell button) on calling for e.g. sOrderID= Trade.buyMarket(sSymbol, nStckQty);?

          Hoping someone can provide some help/pointers

          Thanks

          Comment


          • #6
            Avery:

            Thanks!... that did it.

            At Main Menu -> Trade -> Trade Settings and uncheck both 'Confirm EFS Orders' & 'Confirm orders before submitting' had to be unchecked.

            What is the purpose of having 'Confirm orders before submitting' in addition to 'Confirm EFS orders'?

            Ashok

            Comment


            • #7
              Hi Ashok,

              There are actually two different trading functions the user would be enabling or disabling confirmation for. The order ticket for our standard trading functions, such as trading from Trade Manager, Chart Trading or even the point and click trading are control with the first options (Confirm order before submitting). Any trades triggered via EFS would use the second option.

              AveryH
              eSignal Support

              Originally posted by asrajan View Post
              Avery:

              Thanks!... that did it.

              At Main Menu -> Trade -> Trade Settings and uncheck both 'Confirm EFS Orders' & 'Confirm orders before submitting' had to be unchecked.

              What is the purpose of having 'Confirm orders before submitting' in addition to 'Confirm EFS orders'?

              Ashok

              Comment


              • #8
                Hi Avery,

                I have a question regarding the historical data and live auto trading. Lets say I load up my Live Auto Trading script and the current bar i(15 min) at 9:30:00. I have logic that allows it to enter a trading within the 9:30 candle. Trade.buyMarket returns null within that candle. Once 9:45 candle hits then the Trade executes fine.

                Is the 9:30 candle treated as historical data even though it has new trades coming in?

                Edit: After a bit more playing around, it actually the first tick on a reload that returns null, any ticks after that work fine.


                Last edited by ewdeg98; 03-11-2019, 12:43 PM.

                Comment

                Working...
                X