Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 410 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: Some questions for BrokerAPI(1.96.4) [Re: jcl] #475648
12/31/18 11:44
12/31/18 11:44
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Thx, the update stop button is back laugh
Regarding BrokerAsset: so when the data for the asset is available, but the asset itself is currently not tradeable, then the plugin should return 1 anyway?
I think I will add additional checks for tradeability for all order related commands(BrokerBuy, BrokerStop, BrokerSell).
This is beneficial in giving back a more detailed failure description.

Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475649
12/31/18 11:47
12/31/18 11:47
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted By: AndrewAMD
2) Return 1 regardless of whether the asset is tradeable. You can optionally output asset tradability with GET_TRADEALLOWED.

Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475707
01/04/19 14:51
01/04/19 14:51
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
While implementing the BrokerAsset function, I can see that only the price and spread pointers are valid.
I wonder under which conditions the other pointer outputs are ready to be written.
I opened a position, but still the pointers are not used by Zorro.
Are they obsolete or do I need to enable something?

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475709
01/04/19 15:28
01/04/19 15:28
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I don't have my IDE open, so let me ask you:

1) Which pointers are valid during the asset subscription phase?
2) Which pointers are valid during the live trading phase?

Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475711
01/04/19 16:13
01/04/19 16:13
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
I have not checked it during the subscription phase, but I know for sure that the price pointer is NULL as I can subscribe the assets.
After subscription is done, I see that only price and spread pointers are valid.
All others are NULL.
After opening a trade, the situation does not change.
Maybe everything is OK, since I check for valid pointers anyway.
I'm just curious under which conditions the other pointers(besides price and spread) become valid.
It also makes sense to test these values when developing a plugin, so I need a way to tell Zorro to use these pointers.

Or it could be that the TradeTest.c script is the wrong tool for that.

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475712
01/04/19 16:21
01/04/19 16:21
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Ok, now I see in the log that the other pointers are valid only sometimes.
When looking at timestamps, I would guess that Zorro queries the other values only once per minute.
Now I can see that all values are set correct and everything works laugh

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475740
01/06/19 08:34
01/06/19 08:34
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Next questions arise for BrokerBuy2:
The manual says for the return value 0 that:
when the market or limit order was not filled within 30 seconds. Not or partially filled orders must be cancelled.
I'm not sure what that means.
Does Zorro support partially filled orders at all?
If you look at the output parameter pFill, then it seems that partial fills are allowed.
On the other hand, when the order was not filled within 30sec(does this mean fully filled?), partially filled ones must be closed.
So, partial fills are not allowed?!
The only scenario where pFill makes sense to me, is when after 30sec the order is still only partially filled.

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475769
01/07/19 16:42
01/07/19 16:42
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
This depends. Does the broker API use a high-level "trades" abstraction or does it only process "orders"?

Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475782
01/07/19 19:49
01/07/19 19:49
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
It's Dukascopy and I think they work only with orders.
But "that depends" should be clearly stated, such that a Broker plugin is fully compliant to the specification.
BrokerBuy2 is in general very unclear to me.
For example, if there is no connection to the broker for 30sec then there is also no order fill.
Should the plugin then return 0 or -2, because both conditions would be satisfied?
And what about the NFA closing way, when the order was rejected.
Then 0 and 1 would be candidates for the result.

In general it would be helpful if the documentation is very strict here, i.e. a boolean matrix with possible return codes, like this:

Order fully filled | Order partially filled(30sec) | Order not filled(30s) | No BrokerConnecition(30s) | NFA-Account =
1 0 0 0 0 Expected Result: TradeId
1 0 0 0 1 Expected Result: 1
0 1 0 0 0 Expected Result: ????
0 1 0 0 1 Expected Result: ????(maybe 1)
0 0 1 0 0 Expected Result: 0
0 0 1 0 1 Expected Result: ????(maybe 1)
0 0 1 1 0 Expected Result: 0 or -2
0 0 1 1 1 Expected Result: 0,-2 or 1

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475794
01/08/19 10:20
01/08/19 10:20
Joined: Jan 2017
Posts: 95
Bulgaria
kvm Offline
Junior Member
kvm  Offline
Junior Member

Joined: Jan 2017
Posts: 95
Bulgaria
I agree with you, that the API is not very well defined. For example, see the link below:

https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=473867#Post473867

But in case with Dukascopy you can port your strategy to Java and execute it directly inside the JForex environment.

Page 2 of 4 1 2 3 4

Moderated by  Petra 

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