Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2.33 brokerTrades(1); #481680
10/19/20 06:43
10/19/20 06:43
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Used it with MT4 bridge, removed all trades from Zorro.

Did not add the missing ones, but removed all.
Assume I should not have done that, since on the MT4 bridge it does not state it is supported. blush

Re: 2.33 brokerTrades(1); [Re: danatrader] #481681
10/19/20 08:03
10/19/20 08:03
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Did install latest MT4 bridge, 2.06 vs. 2.09, maybe that is why?

Last edited by danatrader; 10/19/20 08:14.
Re: 2.33 brokerTrades(1); [Re: danatrader] #481682
10/19/20 09:44
10/19/20 09:44
Joined: Feb 2017
Posts: 1,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,726
Chicago
No. Your plugin must support GET_TRADES for this to work correctly.

Re: 2.33 brokerTrades(1); [Re: danatrader] #481683
10/19/20 09:59
10/19/20 09:59
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Bad luck, did check the new MT4 bridge Version, didn't find it, just wanted to be sure.
Although, then besides me being silly, the bug is, that it does anything, although the brigde doesn't support it ---> very dangerous.


Possible solution, if tradestruct holds trades and brokerTrades(1) returns nothing or zero, throw message log.
Hint user to clean his trades if wanted by removing .trd file manually, or implement a force switch.

Last edited by danatrader; 10/19/20 10:27.
Re: 2.33 brokerTrades(1); [Re: danatrader] #481691
10/19/20 13:20
10/19/20 13:20
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
GET_TRADES returning zero can mean that this command is not supported, but also that no trade is open. You can use that command only when a) the plugin supports it and b) only a single Zorro instance trades with that broker and there is no manual trading. In other words, you must know exactly how and what for you want to use it.

Re: 2.33 brokerTrades(1); [Re: danatrader] #481696
10/19/20 14:09
10/19/20 14:09
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Exactly, so I would suggest if the plugin does not support it, it does nothing. Cause if trade struct contains trades, but even if plugin supports the command but for any reason returns "" or 0, it should not wipe the Trades from the struct.

Re: 2.33 brokerTrades(1); [Re: danatrader] #481697
10/19/20 14:13
10/19/20 14:13
Joined: Feb 2017
Posts: 1,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,726
Chicago
Reread this:
Quote
GET_TRADES returning zero can mean that this command is not supported, but also that no trade is open.
Zorro does not necessarily know whether or not GET_TRADES is supported, but you do. The documentation will tell you whether or not GET_TRADES is supported. No trades detected means all your trades will get replaced with no trades. You should not expect any other behavior.

Re: 2.33 brokerTrades(1); [Re: danatrader] #481698
10/19/20 14:31
10/19/20 14:31
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
From a developers point of view, that is totally correct.
Just since it does that without any further possibility do catch it, so even if you develop, and for any reason your API returns nothing, you can't catch that behaviour in your code, cause it just does what it does.

But besides that, it's just a question of perspective, i wonder @JCL do you plan on implementing that feature for MT4/5 bridge?
Cause that is really a nice one.

Last edited by danatrader; 10/19/20 14:32.
Re: 2.33 brokerTrades(1); [Re: danatrader] #481699
10/19/20 15:06
10/19/20 15:06
Joined: Feb 2017
Posts: 1,726
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,726
Chicago
Okay, then let's talk about the "perspective":
Quote
even if plugin supports the command but for any reason returns "" or 0, it should not wipe the Trades from the struct.
If the broker shows that no trades are open, and your intent is to update your Zorro trades to synchronize with that of the broker, then it is only correct to delete all trades on the Zorro-side.

For example, if IB closes all of my positions (due to risk mitigation), I would certainly want my Zorro-side trades to be removed. If the Zorro-side trades were not removed, and I tried to close the trades on the Zorro side, I'd accidentally open a position in the wrong direction!

Re: 2.33 brokerTrades(1); [Re: danatrader] #481700
10/19/20 16:16
10/19/20 16:16
Joined: Mar 2019
Posts: 357
D
danatrader Offline OP
Senior Member
danatrader  Offline OP
Senior Member
D

Joined: Mar 2019
Posts: 357
Yes, you are right.
Thank you for sharing your thoughts about it and once you point it out, I fully agree.

I really would love that feature in MT4 / 5 too, it definitly is a really nice one.

Edit: I can confirm it works blush

Last edited by danatrader; 10/19/20 16:29.

Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1