Portfolio Trader: Trading on close / accessing partial bars
Posted: May 03 2016
Hi there
I have this strategy which is supposed to trade every day just before the exchange (Nasdaq) closes. I want it to trade all Nasdaq components which is why I'm using your wonderful Portfolio Trader.
In backtest scenarios this works well. Here, I can simply rely on the CalcBar() event and pretent to trade literally "on close".
In real trading, however, after numerous attempts to make that thing behave the way I want, including various combinations of
- viewtopic.php?f=1&t=8414
- https://www.tradingcode.net/multicharts ... ior-close/
- attributes like AllowSendOrdersAlways and IOGMode
- changing the IB plug in settings to allow trading outside RTH
- tweaking the exchange opening hours in QuoteManager e.g. from 16:00 to 15:57
- using a second data series (1 min)
I find myself stuck with no real success.
I may well have missed some combinations of the above options. But the closest I could get to make this somehow work was - if I remember correctly - using ExecControl.RecalcLastBarAfter() and wait for a specific time to execute my strategy. However, I obviously need access to the current partial (!) daily bar to make my trading decision and wasn't able to find out how to access that information.
Any help on the topic is greatly appreciated.
I have this strategy which is supposed to trade every day just before the exchange (Nasdaq) closes. I want it to trade all Nasdaq components which is why I'm using your wonderful Portfolio Trader.
In backtest scenarios this works well. Here, I can simply rely on the CalcBar() event and pretent to trade literally "on close".
In real trading, however, after numerous attempts to make that thing behave the way I want, including various combinations of
- viewtopic.php?f=1&t=8414
- https://www.tradingcode.net/multicharts ... ior-close/
- attributes like AllowSendOrdersAlways and IOGMode
- changing the IB plug in settings to allow trading outside RTH
- tweaking the exchange opening hours in QuoteManager e.g. from 16:00 to 15:57
- using a second data series (1 min)
I find myself stuck with no real success.
I may well have missed some combinations of the above options. But the closest I could get to make this somehow work was - if I remember correctly - using ExecControl.RecalcLastBarAfter() and wait for a specific time to execute my strategy. However, I obviously need access to the current partial (!) daily bar to make my trading decision and wasn't able to find out how to access that information.
Any help on the topic is greatly appreciated.