Broker or Zorro Messages?

Posted By: DdlV

Broker or Zorro Messages? - 06/14/21 14:08

Over the past month messages as the following have appeared when trading at Oanda:

Code
!Gateway Timeout. 
!Gateway Timeout. 
!Gateway Timeout. 
!Gateway Timeout. 
!Gateway Timeout. 
!Gateway Timeout. 
!Trade not open - xxxx
!Result: {"errorMessage":"Gateway Timeout."}


My recollection is that anything starting with "!" is a message from the Broker, not Zorro, which would mean that both "Gateway Timeout." and "Trade not open - xxxx" came from Oanda (or Oanda's API).

Is this understanding correct?

Also, would Black Box Recording (BBR) provide more information that Oanda could find helpful in resolving this? Is it worth running in BBR for some time?

Thanks.
Posted By: jcl

Re: Broker or Zorro Messages? - 06/15/21 07:26

"!" can also be a message from the plugin, but "Gateway Timeout" is likely from Oanda. Oanda will not provide more information when it's black box recorded.
Posted By: DdlV

Re: Broker or Zorro Messages? - 06/15/21 11:29

Thanks @jcl. I was afraid the answer might be like that. Oanda has already taken the position "ask the software provider" to resolve.

With no additional info available, even with BBR, it seems there's no way to resolve what happened? It hasn't happened again for a couple of weeks...
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/02/22 04:54

Hi @jcl. Sorry for the necro-post, but these errors have begun again. As before, neither Oanda nor Black Box are any help. The errors show only in the log, not in diag.txt, in neither case with any additional information. Example errors are:

Code
!Trade not found - v3/accounts/xxx-xxx-xxxxxxx-xxx/trades/xxxx


and

Code
!Trade not open - xxxx
!Result: <html>
<head><title>524 Origin Time-out</title></head>
<body bgcolor="white">
<center><h1>524 Origin Time-out</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>


While the "cloudflare" reference points to a security change on Oanda's side, I don't expect you have any more insight than before. Rather, I'd like to suggest/request that when a plugin posts an error, it also post the Broker command(s)/interaction that precedes the error.

Thanks.
Posted By: Petra

Re: Broker or Zorro Messages? - 05/02/22 09:10

Use the DIAG flag for Verbose. You will then see all broker commands and their return values in the diag.txt.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/02/22 17:03

Thanks Petra. But doesn't Verbose=15 mean DIAG flag is on? I.e., DIAG=8 and 7+8=15...
Posted By: Petra

Re: Broker or Zorro Messages? - 05/03/22 13:34

Yes, DIAG is 8, so with 15 you have already a diag.txt and should see the broker commands inside. Look for BrokerBuy, BrokerSell etc.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/03/22 19:05

Thanks Petra.

- I only see (lots of) "BrokerAsset" and "BrokerTime". It appears the file has overwritten itself and all prior information lost - is this how diag.txt works? I have always had trouble understanding diag.txt files - they always seem to be incomplete...

- What is the difference between <strategy>diag.txt and <strategy>_<asset>diag.txt? Under what conditions is each of these files created and written to?

Thanks.
Posted By: Petra

Re: Broker or Zorro Messages? - 05/04/22 11:50

The diag.txt contains only the 10000 most recent events. The asset name is included when the strategy is not for a specific asset.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/04/22 18:14

Thanks @Petra.

I seem to get both diag.txt files every time...

More importantly, Zorro locks the diag.txt file hard. How can I access the diag.txt file without stopping Zorro?

Thanks.
Posted By: jcl

Re: Broker or Zorro Messages? - 05/05/22 17:15

You cannot open a file while another app is just writing into it. But you can open it while Zorro is not writing, for instance when you click Stop and the Messagebox pops up.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/05/22 19:22

Thanks @jcl.

Yes, I understand write locks. However, it seems *diag.txt is _always_ locked - as compared to log files which seem to be copy-able any time.

I will try the Stop trick.

Thanks.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/09/22 04:21

@jcl,

Tried the Stop trick - didn't work - tried with both prompt windows open - Zorro still has diag.txt locked.

Any other ideas?

Thanks.
Posted By: jcl

Re: Broker or Zorro Messages? - 05/09/22 11:22

It's clear that the diag.txt file is often locked because Zorro writes all the time into it. But it should not be locked when nothing is written. I'll inquire what may be the reason, and wil then get back to you.

Update: The diag file indeed remains locked during the whole session for speed reasons. So you must really stop the session for reading it, then restart the session. I've put reading it with the stop trick on our todo list. It will be implemented in the next beta.
Posted By: DdlV

Re: Broker or Zorro Messages? - 05/09/22 19:09

Thanks @jcl.

I don't suppose this qualifies as a "critical bug"? laugh (Even though it's been a quite annoying issue since the beginning...) I'll keep looking...

Thanks.
© 2024 lite-C Forums