[bug]Stop Sending out too many messages at the same time

Questions about MultiCharts and user contributed studies.
oliveagle
Posts: 20
Joined: 07 Jul 2011
Has thanked: 4 times
Been thanked: 4 times

[bug]Stop Sending out too many messages at the same time

Postby oliveagle » 09 Sep 2011

After working around this problem with MC support some time, I find out a solution.
it is still the old one:

Code: Select all

variables:
intrabarpersist aBar(0); // intrabarpersist is the key

if aBar <> currentbar then begin
aBar = currentbar;
// all calculation and signals are here
end;

maybe [IntrabarOrderGeneration = False] will do the same, but I'm not sure. coz in my experience, [IntrabaOrderGeneration = False] often fails .... I don't know why... maybe I run two scripts together, one is saying [IntrabaOrderGeneration = False] and another is saying [IntrabaOrderGeneration = True] ......╮(╯3╰)╭


----------------------old msg -------------
Every day when I wake up and logged into my workstation, and found MC lost its connection with FXCM. I thought it was a problem of networking. Now It's more clear that it's not a problem of networking. I turned MC on with out any strategy for the whole night. connect doesn't lost the next day. Once I add some strategy and run it the whole night. the connect lost the next day...

sucks..Then I dig into the log files find out some very interesting things.

Here is some very basic counting of the FXCMTradingSystem_Trace.txt

Firstly I remove lines containning "UpdateAccount: ", "UpdateOrderStatus ". they are useless and takes up almost 80% of the log. sucks idea... @x@.. you should keep logs tight.

Then mark some string patterns to see how many times these patterns repeated. here is the result of the normal part of the log

Code: Select all

Counts String Pattern
19 => fxcm_server::details::CFXCMServerImpl::PlaceOrder
19 NEW ORDER:
19 <= fxcm_server::details::CFXCMServerImpl::PlaceOrder Time
19 CreateFixOrder hr= 0
19 PLACED ORDER:
19 ) Ask=
19 )trades: AccountID=

10 Place entry order : ID -
10 Hedging: Y
18 )closed trades: AccountID=

9 ) Place exit order : ID -
9 )FreeOutdatedOrFilledPosInfoData:

38 )orders: AccountID=
37 OnRowBeforeRemove
38 OnRowAdded:
2 OrdersProcessingBasis: PerTradeBasis

0 condition is false; FILE - .\FXCMServer.cpp, LINE - 76


time of the first row [0x00001584](09.09.2011 - 13:11:15.719)
time of the last row [0x00001584](09.09.2011 - 15:04:54.172)
here is ErrorPart of the log

Code: Select all

Counts String Pattern
542 => fxcm_server::details::CFXCMServerImpl::PlaceOrder
1 NEW ORDER:
542 <= fxcm_server::details::CFXCMServerImpl::PlaceOrder Time
1 CreateFixOrder hr= 0
542 PLACED ORDER:
1 ) Ask=
1 )trades: AccountID=

1 Place entry order : ID -
1 Hedging: Y
0 )closed trades: AccountID=

0 ) Place exit order : ID -
0 )FreeOutdatedOrFilledPosInfoData:

2 )orders: AccountID=
1 OnRowBeforeRemove
2 OnRowAdded:
1 OrdersProcessingBasis: PerTradeBasis

541 condition is false; FILE - .\FXCMServer.cpp, LINE - 76


time of the first row [0x00001584](09.09.2011 - 15:14:55.875)
time of the last row [0x00001584](09.09.2011 - 15:15:10.625)
540+ messages sent out within 16 seconds.

It's clear MC has some bugs in Exception Handling process. MC is flooding the server!
the log file I already sent to you and your support said it's a problem of broker side... really? I don't think so. I guess, MC flooding broker's server and then the server's firewall cut my connections down. So I have to restart MC to connect to broker's server.
Last edited by oliveagle on 15 Sep 2011, edited 3 times in total.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: [bug]Stop Sending out too many messages at the same time

Postby bowlesj3 » 10 Sep 2011

I can't help with the problem but if you have not had much of a chance yet to learn the bug tracker it needs to go in there with a link to this thread so you do not need to retype it. Also the bug tracker itself has some word wrap issues not yet fixed so retyping is not a good idea anyway.. You get status updates if it is in there etc. Others can vote on its importance and comment as well. Another thing, if you add a new comment there they get an email notice. If you add a comment here they have to get around to reading it.

oliveagle
Posts: 20
Joined: 07 Jul 2011
Has thanked: 4 times
Been thanked: 4 times

Re: [bug]Stop Sending out too many messages at the same time

Postby oliveagle » 12 Sep 2011

Interesting, I even don't know they have this feature... x.x
hope they find out the problem and come up with an good solution in next release.

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

Re: [bug]Stop Sending out too many messages at the same time

Postby Dave Masalov » 12 Sep 2011

Dear oliveagle,

Firstly, let me point out that not all the messages that you see in logs are sent from MultiCharts to the broker, the greater half of them are 'incoming' messages from broker. Indeed, MultiCharts sends a very high number of messages to FXCM, but the reason is that your strategy generates market orders very often. As we can see from the logs, you trade from two charts and send up to 4 market orders per second (near to midnight). You should also take into account the fact that for every market order MC can send a cancellation message if the next order is generated before we receive the status for the previous one.

To reduce number of messages sent to your broker you can optimize the code of your strategy in order to reduce number of orders generated by your strategy or try to use a separate account for every strategy. Please describe your setup in details: what chart resolutions do you use, is your strategy a scalping one?

Here is a piece of a log file demonstrating the activity of your strategies:

Line 236517: [0x00000BF4](08.09.2011 - 23:04:30.125) [id=684971546] ON ORDER ACCEPTED : IntID=684971604 B_ID=127505728 FEB_ID=127503352 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 236518: [0x00000BF4](08.09.2011 - 23:04:30.141) [id=684971546] ON ORDER FILLED : IntID=684971604 B_ID=127505728 FEB_ID=127503352 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @1.39308, 1 form entry 0
Line 236522: [0x00000BF4](08.09.2011 - 23:04:30.141) [id=684971546] ON ORDER ACCEPTED : IntID=684971604 B_ID=127505729 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 236523: [0x00000BF4](08.09.2011 - 23:04:30.141) [id=684971546] ON ORDER ACCEPTED : IntID=684971604 B_ID=127505729 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 236524: [0x00000BF4](08.09.2011 - 23:04:30.157) [id=684971546] ON ORDER FILLED : IntID=684971604 B_ID=127505729 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @1.39306, 1
Line 236537: [0x00000BF4](08.09.2011 - 23:04:30.172) [id=758932406] ON ORDER ACCEPTED : IntID=684971605 B_ID=127505730 FEB_ID=127504362 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 236544: [0x00000BF4](08.09.2011 - 23:04:30.172) [id=758932406] ON ORDER ACCEPTED : IntID=684971605 B_ID=127505730 FEB_ID=127504362 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 236549: [0x00000BF4](08.09.2011 - 23:04:30.172) [id=758932406] ON ORDER ACCEPTED : IntID=684971605 B_ID=127505730 FEB_ID=127504362 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 236550: [0x00000BF4](08.09.2011 - 23:04:30.172) [id=758932406] ON ORDER FILLED : IntID=684971605 B_ID=127505730 FEB_ID=127504362 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @1.59862, 1 form entry 0
Line 236554: [0x00000BF4](08.09.2011 - 23:04:30.188) [id=758932406] ON ORDER ACCEPTED : IntID=684971605 B_ID=127505731 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 236555: [0x00000BF4](08.09.2011 - 23:04:30.188) [id=758932406] ON ORDER ACCEPTED : IntID=684971605 B_ID=127505731 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 236564: [0x00000BF4](08.09.2011 - 23:04:30.907) [id=758932406] ON ORDER FILLED : IntID=684971605 B_ID=127505731 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @1.59866, 1
Line 238654: [0x00001794](08.09.2011 - 23:09:29.000) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506155 FEB_ID=127505345 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 238655: [0x00001794](08.09.2011 - 23:09:29.454) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506157 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 238686: [0x00001794](08.09.2011 - 23:09:30.000) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506158 FEB_ID=127505731 OrignT= SX market ROB_ID=-1 Clipped=0 OrderID = 0 SX market @-1, 0 form entry 1
Line 238687: [0x00001794](08.09.2011 - 23:09:32.313) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506159 FEB_ID=-1 OrignT= LE market ROB_ID=-1 Clipped=0 OrderID = 0 LE market @-1, 0
Line 238697: [0x00000BF4](08.09.2011 - 23:09:32.375) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506155 FEB_ID=127505345 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 238698: [0x00000BF4](08.09.2011 - 23:09:32.375) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506155 FEB_ID=127505345 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 238699: [0x00000BF4](08.09.2011 - 23:09:32.375) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506155 FEB_ID=127505345 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @-1, 0 form entry 0
Line 238700: [0x00000BF4](08.09.2011 - 23:09:32.391) [id=759000171] ON ORDER FILLED : IntID=684971606 B_ID=127506155 FEB_ID=127505345 OrignT= LX market ROB_ID=-1 Clipped=0 OrderID = 1 LX market @1.598, 1 form entry 0
Line 238704: [0x00000BF4](08.09.2011 - 23:09:32.407) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506157 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 238705: [0x00000BF4](08.09.2011 - 23:09:32.422) [id=759000171] ON ORDER ACCEPTED : IntID=684971606 B_ID=127506157 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @-1, 0
Line 238706: [0x00000BF4](08.09.2011 - 23:09:32.422) [id=759000171] ON ORDER FILLED : IntID=684971606 B_ID=127506157 FEB_ID=-1 OrignT= SE market ROB_ID=-1 Clipped=0 OrderID = 1 SE market @1.598, 1
Line 238733: [0x00000BF4](08.09.2011 - 23:09:32.422) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506158 FEB_ID=127505731 OrignT= SX market ROB_ID=-1 Clipped=0 OrderID = 0 SX market @-1, 0 form entry 1
Line 238734: [0x00000BF4](08.09.2011 - 23:09:32.438) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506158 FEB_ID=127505731 OrignT= SX market ROB_ID=-1 Clipped=0 OrderID = 0 SX market @-1, 0 form entry 1
Line 238735: [0x00000BF4](08.09.2011 - 23:09:32.438) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506158 FEB_ID=127505731 OrignT= SX market ROB_ID=-1 Clipped=0 OrderID = 0 SX market @-1, 0 form entry 1
Line 238736: [0x00000BF4](08.09.2011 - 23:09:32.438) [id=758932406] ON ORDER FILLED : IntID=684971607 B_ID=127506158 FEB_ID=127505731 OrignT= SX market ROB_ID=-1 Clipped=0 OrderID = 0 SX market @1.59834, 1 form entry 1
Line 238740: [0x00000BF4](08.09.2011 - 23:09:32.438) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506159 FEB_ID=-1 OrignT= LE market ROB_ID=-1 Clipped=0 OrderID = 0 LE market @-1, 0
Line 238741: [0x00000BF4](08.09.2011 - 23:09:32.438) [id=758932406] ON ORDER ACCEPTED : IntID=684971607 B_ID=127506159 FEB_ID=-1 OrignT= LE market ROB_ID=-1 Clipped=0 OrderID = 0 LE market @-1, 0
Line 238746: [0x00000BF4](08.09.2011 - 23:09:33.266) [id=758932406] ON ORDER FILLED : IntID=684971607 B_ID=127506159 FEB_ID=-1 OrignT= LE market ROB_ID=-1 Clipped=0 OrderID = 0 LE market @1.59834, 1
Line 247705: [0x00001794](08.09.2011 - 23:39:31.454) [id=759000171] ON ORDER REJECTED : IntID=684971608 B_ID=-1 FEB_ID

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: [bug]Stop Sending out too many messages at the same time

Postby bowlesj3 » 13 Sep 2011

Interesting, I even don't know they have this feature.
Maybe this thread is worth reading (and even updating) after you get a chance to learn more about the bug tracker.
viewtopic.php?f=1&t=8806


Return to “MultiCharts”