Autotrade Strategy/Signal Execution problem in real-time

Questions about MultiCharts and user contributed studies.
davidchow
Posts: 3
Joined: 01 Jul 2009
Location: Hong Kong
Contact:

Autotrade Strategy/Signal Execution problem in real-time

Postby davidchow » 11 Aug 2010

Hi,

I have been using multicharts for strategy development for almost 2 years . We found lots of problem when executing a strategy in real-time comparing with backtest. I use esignal as datafeed. We use volume charts.

1. Problems found in backtest with historical data
We have indicators and signals sharing the same code base . However, we got different results in signals comparing with indicator . For example, we calcuate the sum of difference of (UpTicks-DownTicks) for each bar. It can be different when running the same piece of code within the indicator and the signal over historical data. This is obviously a bug. This will obviously led to an unknown or unexpected behaviour comparing with backtest results when using the signal for autotrade.

2. Missing ticks in real-time datafeed
When using Multicharts with esignal, we found multicharts does skip or missing ticks from real-time data feeds from esignal. We can tell this by open a chart collecting data from esignal in real-time . After market close, we dump the ticks with quotemanger. Then we delete the ticks of the session. Then we reload the ticks from esignal, and redo a dump of ticks with quotemanager. We found ticks missing in the real-time collected data . For example, 09:45:07 have 6 ticks in reloaded historical tick data, and there were only 3 ticks in the realtime collected data . It looks like it happens when many ticks traded within one-second (high frequency cases).
I reviewed the esignal API, when tick data comes in, it is an event driven API and will simply do a callback to the application through the esignal API to collect the data. But if the application don't collect the data, then it will not resend that tick, it will simply be dropped. I suspect Multicharts is dropping ticks like this.
This is the biggest problem we have at the moment, because the result of a strategy is unstable in real-time. Sometimes we see unwanted entry signals, and some times we see unwanted exit signals. After reloading the chart histories, then it is back to what we expect.

3. Identical chart, indentical signal/indicator, can have different results in real-time
We have 2 identical charts (a copy within the same multicharts session) . We achieve different results in real-time . Most of the time both charts does have entry signals and exit signals at the same time. But 1 out of 5 times one chart has entry signal, but other one doesn't. If we reload the charts, then the result is consistent in both charts. I suspect this is related to problem no.2 . What I am curious is that both charts running the same multicharts session, if there is problem from the datafeed, then they should behave the same. So it looks like another bug, may or may not related with problem 2 . Our strategy have a few trades a day. And now it almost happen once within 2 days.

4. Not sending the correct number of contracts to broker
We use Interactive Brokers . We coded our application to do multiple contracts entry using limit order. For example, we suppose to trade with 2 contracts, and end up only 1 is filled. I checked logs from IB, it clearly shows multicharts only requested order for 1 contract, not 2. This problem happens randomly. Since we use limit orders for entry, there might be case that 1 contracts is filled while the other 1 is left. We use the following code to ensure this case is handled
if MarketPosition>0 then
//Fill unfilled orders
Buy("VL1F LE") (Order_Pos-currentcontracts) contracts next bar at Order_Price limit
else
Buy("VL1 LE") Order_Pos contracts next bar at Order_Price limit;

Order_Pos is an EL variable in a signal, and always set to Trade_ContractSize, and Trade_ContractSize is an input variable of the signal.

When we use 2 identical charts to trade 2 IB accounts, sometimes one account received 2 contracts order, and the other one receive only 1 contract order. The two MC chart of the corresponding linked account shows 2 and 1 . And the IB TWS log shows that MC really only send 1 contract limit order . That means, the "currentcontracts" code above is never used. It is just there for in case. This look like related to problem 3 , but it looks like to me it is a bug in easy language not assigning variable "Order_Pos" the correct value, or Trade_ContractSize (input variable) is incorrectly assigned. We always double check the "Format Signal" to see if we input the correct values to the signal .

We are completely stucked in the above problems. We want to apply our strategy for autotrade. Because have very positive forward testing results, but they were never true when running the strategy in real-time . These forward test can only run correctly with historical backtest.

Does anyone ever successfully use Multichart to execute strategy in realtime with IB?

I can say, our signal does requires a lots of CPU power to do calculation. Because it is a tick-based algorithm.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Autotrade Strategy/Signal Execution problem in real-time

Postby Dave Masalov » 12 Aug 2010

Dear davidchow,

Regarding the difference in the historical and real-time data, it comes from different eSignal servers so the data can be slightly different. Moreover, if you have two identical charts, the data requests may be sent to different real-time servers, which may provide different data. This is a known issue on a data provider’s side.

As for other problems, please come to our Live Chat (https://www.multicharts.com/support/contact/) between 6:30AM and 11AM EST so we can connect to your PC remotely and analyze the situation.


Return to “MultiCharts”