Signal disappeared from chart - IB data - PC clock

Questions about MultiCharts and user contributed studies.
hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Signal disappeared from chart - IB data - PC clock

Postby hilbert » 21 Aug 2011

Hello All,

I recently purchased MC and witnessed a very strange issue twice in the last week itself. I am using IB feed to construct a EURUSD 30minute bar chart and buying/selling next bar at open, when some conditions are met. Last Thursday, the strategy generated a SellShort order and after passage of around 10 minutes, the order disappeared from the chart. Please note that I am not auto-trading now, I was just experimenting with the back-testing and real time signal generation capabilities of MC. Funny thing was: even though the sellshort signal had vanished from the chart, on the left side 'Data Window' it was still showing a short 10k at 1.42905. I was smart enough to take a print screen then. Please see the attachment at this point to see how situation looked then. I tried removing and again applying the signal, but now the signal didn't generate.

Confused after few hours, I opened a new chart of EURUSD 30 min using IB datafeed. This chart generated the same trade. So, at this point I had two different charts of EURUSD (with the same configuration and settings) in the same workspace, but signal got generated on one and not on another. I was quickly losing confidence on MC's ability to backtest accurately, so I exported the data from both the charts to excel for further analysis. Comparing data points in excel, it quickly became clear that for last 1 day data, many prints among OHLC were different for the two charts.

At this point, I searched the forums extensively, going through 100-200 discussions over the weekend. I found that some people also experienced similar issues and learning from their experience, I then looked at my PC clock. My PC clock was slower by 53 seconds compared to accurate time on the web and TWS. I modified my registry settings to sync my PC clock with a correct clock from net every 1 hour. Testing this for last 8 hours, I have noticed a maximum of 1 second difference between TWS time and my PC clock time, which is a huge improvement from 53 seconds difference.

At this point, it seems that differences in OHLC data among realtime and historical datafeed can be explained because the bars being formed on MC chart using realtime data from IB was 53 seconds late compared to bars being formed using IB's historical data. Further, there could be some differences between historical and realtime IB feeds also as they are probably coming from different servers, as suggested by (Stan Bokov) in

http://www.multicharts.com/discussion/v ... l+realtime

At least, I hope this is the partial answer to the erratic behavior of signals I observed last week.

Even if above deduction is true, one question remains unanswered:

One chart had real time IB data and another had IB backfilled data and IB realtime data was 53 seconds late. This should explain the difference in signals among two charts. However, what it does not explain is "why the shortsell signal disappeared in the real time chart after around 10 minutes" ?

Please help. Thanks.
Attachments
MC_signal disappeared.jpg
(145.45 KiB) Downloaded 648 times

hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Re: Signal disappeared from chart - IB data - PC clock

Postby hilbert » 21 Aug 2011

Following is my code that I used:

Code: Select all

Inputs: m(1.9);
variables: cbarsize(0);
cbarsize = m*average(range,50);

condition1 = close - open > cbarsize;
condition2 = close - open < -cbarsize;

if condition1 then
buy next bar at open;
if condition2 then
sellshort next bar at open;

Please note that in realtime, I was using a value of m = 1.8 and the short signal was generated. After 10 minutes, when the shortsignal vanished, I was able to regenerate the short signal for m <=1.6. So, this means that something definitely changed in my pre-loaded data for the last 50 bars (10 minutes after the signal was generated), to result into signal being generated for m<=1.6 but not for m=1.8.

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

Re: Signal disappeared from chart - IB data - PC clock

Postby Dave Masalov » 25 Aug 2011

Hilbert,

Incorrect PC clock settings is the most possible reason of the issue. Please close Multicharts and all its applications (i.e. MC, Quote Manager, PL editor etc.).
Make sure that all MC processes are ended.
In the Windows Task manager check these processes:
atCenterServer.exe
Fixserver.exe
MultiCharts.exe
MessageCenter.exe
PLEditor.exe
QuoteManager.exe
StudyServer.exe
tsServer.exe
TradingServer.exe
TPserver.exe
Please end the processes if they are still running after MC close.
Then please synchronize your PC clock. Make sure that your local time and time zone (including daylight settings) are correct. When it's done please start the Quote Manager. You can rename/delete the symbol and add a new one or clear cache for the symbol and delete data.Close the Quote Manager and make sure that all processes are closed in Task manager. Now the data should be saved to the database and the signal should generate the orders properly.

If the problem persists, please come to our Live Chat Mon-Fri between 6:30AM and 2PM EST for investigation.

hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Re: Signal disappeared from chart - IB data - PC clock

Postby hilbert » 25 Aug 2011

Thanks Dave for your response.

I am synchronizing my PC Clock with pool.ntp.org server every 1 hour. However, even after immediately synchronizing my PC clock, I see a difference of about 0.5-2 second between my PC clock and IB TWS time. Currently, I am doing strategy development at 10-30 minute time frame. Going forward, I will be moving to sub-minute time frame and then, strategy development using sub-minute data will raise problems again.

Since I am synchronizing my PC clock against pool.ntp.org; I presume my PC clock is correct. This implies that IB TWS clock is delayed by 1-2 seconds. Do you know if there is anything I can do to synchronize TWS clock to my PC clock ? Maybe its a question for IB to answer?

Also, other automated guys (taking feed from IB) and trading at subminute level, must have faced this issue before. Anyone wants to share their experience here. Thanks.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Signal disappeared from chart - IB data - PC clock

Postby TJ » 25 Aug 2011

I use dimension4 to sync my PC clock.
The time matches the TWS time to the second.
http://thinkman.com/dimension4/index.htm

The time delay can depend on the distance (hops) you are from the IB server.

hilbert
Posts: 224
Joined: 17 Aug 2011
Has thanked: 76 times
Been thanked: 64 times

Re: Signal disappeared from chart - IB data - PC clock

Postby hilbert » 25 Aug 2011

Thanks TJ,

I am running Vista and dimension4 won't work with it. I am currently in Asia - opposite end of NY (even though I am synching with EST). Distance from IB servers - that might be a reason as you suggest, but I am not sure.

Interestingly, I noticed that if I first change time manually on my PC either + or - by 2-5 minutes and then sync my PC clock with ntp internet time, there is no lag between my PC clock and TWS time. Both of them show the accurate time after updation.

However, if I use automatic synchronization of my PC time with internet time ntp servers (without first manually changing my PC clock), than TWS shows a 1-3 second delay compared to PC clock after the synchronization. At this time, PC clock is accurate, but TWS time is lagging.

Not sure what is happening and what I can do to rectify it!!

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Signal disappeared from chart - IB data - PC clock

Postby TJ » 25 Aug 2011

Thanks TJ,

I am running Vista and dimension4 won't work with it. I am currently in Asia - opposite end of NY (even though I am synching with EST). Distance from IB servers - that might be a reason as you suggest, but I am not sure.

Interestingly, I noticed that if I first change time manually on my PC either + or - by 2-5 minutes and then sync my PC clock with ntp internet time, there is no lag between my PC clock and TWS time. Both of them show the accurate time after updation.

However, if I use automatic synchronization of my PC time with internet time ntp servers (without first manually changing my PC clock), than TWS shows a 1-3 second delay compared to PC clock after the synchronization. At this time, PC clock is accurate, but TWS time is lagging.

Not sure what is happening and what I can do to rectify it!!
Go to this page, scroll down to the section on Trace Route.
You can find information on how to test your internet,
and the response time for a healthy connection.
http://www.interactivebrokers.com/en/ge ... hnical.php

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Signal disappeared from chart - IB data - PC clock

Postby TJ » 25 Aug 2011

Thanks TJ,

I am running Vista and dimension4 won't work with it.
...
I am using Vista; according to their webpage, it is supported by dimension4.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Signal disappeared from chart - IB data - PC clock

Postby Henry MultiСharts » 26 Aug 2011

Hello, Hilbert. Please provide us additional information regarding the issue.
If you click on the View tab-Strategy performance report -is the disappeared from the chart order present in the report?
Please send the workspace you are using to support@multicharts.com for further analysis.
I would like to ask you to come to our live chat Mon-Fri between 6:30AM and 2PM EST if you are able to reproduce the issue.
You can use the command "w32tm /resync" to syncronize the clock. Aftert that-your PC clock and TWS clock should be the same.
The discrepancy between the real-time data and the backfilled data is present because the real time data is received and saved tick by tick, and the data from the IB server is received in minute resolution.


Return to “MultiCharts”