CQG broker showing wrong positions when market is quiet

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

CQG broker showing wrong positions when market is quiet

Postby wilkinsw » 02 Feb 2021

Hi,

There's long existed a bug that I've lived with when using CQG in Multicharts.

Between the hours of about 0200am and 0700am gmt, when markets are typically at their quietest: if my signal sends a market order, it will be filled but the MarketPosition_at_Broker won't update. This is then verified to be the case be cross checking a CQG standalone application against the position shown by the CQG Web API in MC.

I fix the issue by performing an account lookup request. MC hangs for about 5 seconds and then the correct marketpositions show:
cqg account lookup.PNG
(7.43 KiB) Not downloaded yet
Any idea why this is only happening when the markets are quiet?

Is there any code I could insert somewhere that would achieve the same result as performing an account lookup and so refresh the cqg web api positions coming through to MC, automatically?

User avatar
Kate MultiCharts
Posts: 575
Joined: 21 Oct 2020
Has thanked: 7 times
Been thanked: 144 times

Re: CQG broker showing wrong positions when market is quiet

Postby Kate MultiCharts » 11 Feb 2021

Hello wilkinsw,

It is likely that the script wasn’t calculated while the market was quiet.
Please try adding recalclastbarafter(1) keyword to your signal.

If that doesn’t help, please send us logs via the main MultiCharts window -> Help -> Feedback.
Please select the options:
Attach log files…;
Snapshot of the current MC setup;
Open workspaces…;
Upload collected data to help desk;
uncheck other options and click Send.

Also please specify in the commentary section:

1. The time when the issue happened
2. Broker Order ID of the problematic order (Order and Position Tracker -> Orders Tab)
3. The symbol you are using when the issue is reproduced
4. The account you are using for trading when the issue is reproduced
5. Whether or not the Strategy Position is correct in the Order and Position Tracker window -> Open Positions tab.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: CQG broker showing wrong positions when market is quiet

Postby wilkinsw » 11 Feb 2021

Hi Kate,

The wrong position is shown in OPT, Chart Trader and Trade Bar.

It stays that way until I perform an account lookup as previously described (or restart MC).

I can't upload logs unfortunately, as I have all logging (including CQG logs) turned off.

It happens maybe once or twice a week and , as mentioned, only during certain quiet hours. I think typically if a market order is sent.... the broker api doesn't update on the odd occassion.

User avatar
Kate MultiCharts
Posts: 575
Joined: 21 Oct 2020
Has thanked: 7 times
Been thanked: 144 times

Re: CQG broker showing wrong positions when market is quiet

Postby Kate MultiCharts » 24 Feb 2021

Hello,

The behaviour wasn’t reproduced on our end.

Please send us Feedback without the log files and specify the Order ID of the last order before the issue was reproduced.

When the broker profile is connected, Lookup should respond without delay.
The delay might happen if
1. The connection to the broker was lost.
2. Lookup was used by the profile that has settings that differ from the connected data feed/broker profile settings.

Please let us know if you are using the same connection settings for the CQG data feed and broker profile. Do you have 1 CQG profile? Which symbol is causing issues?

Please check Order and Position Tracker -> Logs tab. The message about the position change may not be received if there was a connection loss. Do you get any messages about the connection loss when the position is not changing?

Please check Order and Position Tracker -> Position History tab. After the order is executed, there should be a message about the position change. Is it there?

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: CQG broker showing wrong positions when market is quiet

Postby wilkinsw » 24 Feb 2021

Considering the round trips I do, I would say it will be very difficult to reproduce and capture (it happens very infrequently). Also I have logging off for CQG proxy server trace.

When it happens, there is no log of disconnection.

Sorry, that I'm not being more helpful. As far as I know it's a CQG Web API issue. The broker fill will show on the chart correctly (and in the OPT). It's just the position, on the odd occassion, will not update accordingly.

I can live with it. Thought it would just be worth recording it here for other users.


Return to “MultiCharts”