Announcement

Collapse
No announcement yet.

generic broker - cancelOrder()

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

  • generic broker - cancelOrder()

    Is there a way to cancel a specific order using generic broker functions? cancelOrder() cancels all open orders for a given ticker.

    I want to enter a position via a market order with an integrated broker and immediately send a StopLimit order for a profit target and a StopLimit order for a stop loss.

    Then I want to trail the stop loss StopLimit order. To do this, I need to cancel the existing stop loss StopLimit order and place the new trailed one. When doing the cancel, I am also canceling the profit target StopLimit order which I do not want to do.

    Yes, I can replace the profit target StopLimit order each time I trail, however, in some instances replacing the order may not be accepted by the exchange as its price may have been passed during the process....then I am sitting with no profit target stop and may not know it. Instead I want to leave the profit target stop in place until it is hit and filled or until the trade gets stopped out via the stop loss StopLimit order.

    Which brings up a second question, how will my efs code know when/if an order is filled? I have not found any OnFill kind of functions.

    Thanks in advance.

  • #2
    Hello ratherBgolfing,

    Currently our generic broker functionality is somewhat limited. You will not be able to accomplish the logic you've described with our current group of functions. The cancelOrder() function cancels all orders for your current chart symbol. The cancelAllOrders() function cancels any open orders regardless of chart symbol. You may want to send in some suggestions for enhancements to our generic broker feature to [email protected]. In the mean time you may want to explore a third party trading solution such as NinjaTrader that offers EFS integration.
    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


    • #3
      Jason

      Do the current eSignal EFS2 Generic Broker functions, although very limited if you can not even confirm a Fill, allow eSignal subscribers to place trades with eSignal's list of integrated brokers or is this not possible without using a third party software solution such as you suggested?

      Also, do the integrated broker's in your list provide EFS functions from their end? I notice some samples in the EFS documentation from IB for instance.

      I would be amazed if eSignal subscribers can make all these great computations using sophisticated EFS studies and not be able to simply place trades based on the results of those studies, without third party support. Where are the functions the third party support uses and, if they are EFS, why are they not available to eSignal subscribers?

      Thanks.

      Comment


      • #4
        Update....

        The answers to my various questions are:

        - you need to cancel and place orders using an "orderId" which is available in NinjaTrader and not in eSignal; install NinjaTrader and copy their sample efs code into your efs; then use their functions like:

        function NTCancel(orderId) {
        return NTCommand("Cancel","","",0,"",0,0,"","",orderId,"" ,"");
        }

        - NinjaTrader offers free unlimited access to a simulator account and then $50 per month thereafter for live trading

        -eSignal documentation claims that you can place trades with their list of integrated brokers and eSignal's Paper Broker using eSignal Generic Broker Functions. This is not completely accurate as it would appear you can only "safely" place trades in the Paper Broker and then only on a very limited basis.

        Comment

        Working...
        X