1 registered members (AndrewAMD),
946
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
2.33 brokerTrades(1);
#481680
10/19/20 06:43
10/19/20 06:43
|
Joined: Mar 2019
Posts: 357
danatrader
OP
Senior Member
|
OP
Senior Member
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.
|
|
|
Re: 2.33 brokerTrades(1);
[Re: danatrader]
#481681
10/19/20 08:03
10/19/20 08:03
|
Joined: Mar 2019
Posts: 357
danatrader
OP
Senior Member
|
OP
Senior Member
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]
#481683
10/19/20 09:59
10/19/20 09:59
|
Joined: Mar 2019
Posts: 357
danatrader
OP
Senior Member
|
OP
Senior Member
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]
#481697
10/19/20 14:13
10/19/20 14:13
|
Joined: Feb 2017
Posts: 1,726 Chicago
AndrewAMD
Serious User
|
Serious User
Joined: Feb 2017
Posts: 1,726
Chicago
|
Reread this: 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
danatrader
OP
Senior Member
|
OP
Senior Member
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
Serious User
|
Serious User
Joined: Feb 2017
Posts: 1,726
Chicago
|
Okay, then let's talk about the "perspective": 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
danatrader
OP
Senior Member
|
OP
Senior Member
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
Last edited by danatrader; 10/19/20 16:29.
|
|
|
|