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?
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?
Comment