Noted.tomele » Sat Nov 07, 2020 9:29 pm wrote: As this puts unnecessary load on the trade servers, Nicholas from GP asked me to inform the coder of TradeChart that his program is doing something he might not be aware of. Which I have done hereby.
Over the years I have had many complaints about TradeChart (and also TradeReport), but never something like this. I have never experienced this "bug" myself and I have not been able to reproduce it. So, it is a bit hard to diagnose, let alone fix it.
So, apparently, TradeChart is overloading the trade server with "messages". Looking at the code, the only thing I can see that TradeChart is bothering the trade server with is with the message that says "Enable all Trade History". Some people only want to see just the last day or the last week of trade activity in their "Account History"-tab, but for TradeChart to work well, it needs to have access to the entire history since the beginning of the account. In TradeChart3 and TradeChart4 this message was sent to the trade server every 30 seconds. It is still beyond me that the poor trade server can not handle this but alas.
Anyway, in the new version, this message is only sent once, in OnInit(). So, if someone goes crazy with flipping through timeframes or changing parameters, it could still upset the trade server. However, it should not if you leave the indicator alone.
Also, the new version is making good on my earlier promise to merge TradeReport and TradeChart.
I attach a test version of the new code here ... it is called TestTradeReport, to be renamed to TradeReport when testing is complete. If someone can think of a better name (given that it also contains the TradeChart functionality), please shout.
For now, I will only attach the .ex4 file. But once I've cleaned up the code and the new version has proven to be working well, I will also attach the source code, so that someone can change two lines and sell it on eBay for $99. You're welcome.
PS: In order to see the TradeChart-like metrics (what used to be under the "Info" button), set the ShowExtendedStats parameter to true