Filled before chart updates: Causing an error

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

Filled before chart updates: Causing an error

Postby wilkinsw » 12 Jan 2017

Hi,

I've just had an event occur that I haven't seen before and would like advice on how I avoid it happening again please.

In SA mode.....and flat.......using CQG as broker and IQfeed and data feed.......

I got filled long before the datafeed updated on a fast and sudden move.

The fill event caused my signal to think it was filled on the bar before the actual bar on the chart. This caused the signal to reference values from the wrong bar (a bar earlier than normal). In turn this caused a cascade of decision making that was incorrect (undesired).

My question is, how do I make sure that when I'm notified of a fill by the broker, that it is marked on the correct bar on the chart (or at least that my signal uses variables from the correct bar on the chart)?

Is only trading in AA mode the solution?

Is there a way to trade in SA mode and have signals be in sync with the chart?

I'm thinking that maybe AA mode is the only solution to avoid the script thinking I'm filled a bar early than the chart (e.g. in events when the market has a big sudden move on the turn of the hour, and the broker fill message is faster than the data feed). In AA mode, is the faster broker message ignored entirely and my strategy waits only for the chart to show a fill?

Thanks.

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: Filled before chart updates: Causing an error

Postby Angelina MultiСharts » 18 Jan 2017

Hello wilkinsw,

We are analyzing this behavior. I will get back to you with results.

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

Re: Filled before chart updates: Causing an error

Postby wilkinsw » 09 Feb 2017

Hi,

Can MC get back to me with answers regarding my questions above.

Is AA mode the solution? Is AA mode the only solution?

My code dictates that once filled exit orders are immediately sent and worked. Is there a difference between SA and AA modes regarding the event that triggers the exit orders to be generated by MC? Ie in AA mode will exit orders be generated as soon as the faster broker fill message has been received (like in SA mode) or will it wait for the slower chart fill event?

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: Filled before chart updates: Causing an error

Postby Angelina MultiСharts » 10 Feb 2017

Hello wilkinsw,

Sorry for the delay.
Yes, AA is the solution in this case.
in SA mode MC waits for the broker confirmation that the order is filled and only after receiving such confirmation it is displayed on the chart.
in AA mode the orders will be shown on the chart without waiting for the confirmation.

But AA mode, of course, has its own disadvantages.

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

Re: Filled before chart updates: Causing an error

Postby wilkinsw » 10 Feb 2017

Hi Angelina,

Also, my question about what triggers the sending of exit orders when filled in AA mode. Is it:

a) the broker fill message
or
b) when the chart shows strategy is filled?

Thanks!

User avatar
Angelina MultiСharts
Posts: 260
Joined: 28 Dec 2016
Has thanked: 28 times
Been thanked: 66 times

Re: Filled before chart updates: Causing an error

Postby Angelina MultiСharts » 10 Feb 2017

Sir,

In AA mode it's b) when the chart shows strategy is filled


Return to “MultiCharts”