Announcement

Collapse
No announcement yet.

Bug:Interference between different DEMO accounts on eSignal Paper Trading

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

  • Bug:Interference between different DEMO accounts on eSignal Paper Trading

    So here's my situation, I have 2 efses running on DEMO3 and DEMO4 of eSignal Paper Trading on the same timeframe (in this case I was testing them on 1 minute bars).

    They're different .efs files but otherwise identical except for the one on DEMO4 has an additional exit condition so it often exits trades faster.

    In essence I use Trade.buyMarket() (Trade.sellMarket()) to enter a trade, I place a Trade.sellStop() order below it as a Stop Loss and when the exit condition is met I close the position with with Trade.sellMarket() (Trade.buyMarket()) and also immediately cancel the Trade.sellStop() (Trade.buyStop()) order.

    The issue I'm having is that the version on DEMO4 will exit a trade faster, as it's meant to, cancel its stop loss order with Trade.cancelOrder(OID) properly as it should, but it'll ALSO cancel the stop loss on DEMO3 at the same exact time even though that order has a different ID! I've confirmed this by looking in the Broker Manager window at the internal order IDs and executions.

    1) Does anyone know why this happens?
    2) Is there a way to specify/reinforce what account to go through within the Trade functions themselves?
    3) Upon careful examination of my code I've noticed that my order cancelling sequence is a bit extreme:
    ....
    if (bsoid!=null) Trade.cancelOrder(bsoid);
    Trade.cancelAllOrders(getSymbol());
    ....

    Could the cancelAllOrders function be working across all DEMO accounts of esignal Paper Trading? Is it supposed to work like that?

  • #2
    Your conclusion is correct.

    From the EFS-AT documentation:

    "Multi object operating functions (i.e. Trade.cancelAllOrders() ) will use their parameters like filter criteria. For example, above mentioned function will cancel all orders on all accounts."

    However, the function syntax (same source doc) allows you to cancel all orders in one symbol, one account, and one broker connection:

    Trade.cancelAllOrders ( [Symbol] [, Account] [, Connection] )
    Cancels all working orders for the specified symbol, account and/or connection.

    I used to use this function but later opted to track all orders individually and cancel each individually. When trading through IB, I realized that in rare instances an order should have cancelled by EFS but did not (for reasons which I never determined). Therefore, I decided to cancel each order individually and later confirm each cancellation by looking at Order.state(). One can use other ways to reach the same outcome. For example, one could use Trade.cancelAllOrders and then confirm the orders were cancelled by using Trade.getOrders() with appropriate arguments.

    I have never encountered an instance when I intentionally cancelled a set of orders in one account that resulted in the accidental cancellation of orders in another account.

    Comment

    Working...
    X