Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 4 1 2 3 4
Re: Some questions for BrokerAPI(1.96.4) [Re: kvm] #475795
01/08/19 11:44
01/08/19 11:44
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Hi kvm,

I just wanted to update the Dukascopy plugin, which I'm the author.
In order to provide a good compliance quality, I need to have a specification with as little ambiguaties as possible.
The BrokerBuy2 description raises too many of them.
There is also the issue of BrokerHistory2 for Dukascopy.
This broker sends ticks on a ask and bid basis, which means you can have multiple ticks in a row with the same ask price(but different spreads, vol, etc.)
Here I'm not sure if I have to filter these ticks out of the stream.

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

Joined: Jan 2017
Posts: 95
Bulgaria
Hi ibne,

What a coincidence laugh I'm the author of the Dukascopy plugin (yet another version)

I'm not filtering these ticks. Just returning the last one received.

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

Joined: Dec 2014
Posts: 56
So we can join forces on trying to undertsand the Zoro API laugh

Not filtering these ticks might look very strange on a tick chart, with periods of a "flat" line.
I guess this defeates the purpose of a "tick", which to me means a price change.

Btw: when you also work with Dukascopy, you will agree that their API is even more broken...

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

Joined: Jan 2017
Posts: 95
Bulgaria
I'll be glad to collaborate with you!

I'm using these ticks coming from Strategy.onTick() method only to return the current price information via brokerAsset() method.

When Zorro calls brokerHistory2() then I'm using History.getTicks() to retrieve them.

In my opinion the Dukascopy API is too complicated but decent. However, the implementation is not the best one. What version do you use?

Re: Some questions for BrokerAPI(1.96.4) [Re: kvm] #475802
01/08/19 14:48
01/08/19 14:48
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
The latest one:
DDS2-jClient-JForex 3.4.13
JForex-API 2.13.62

Their API is overloaded and not very user friendly.
Take for example the IEngine.executeTask() method.
Why should the user take care on which thread he is when executing order related tasks?
The API could handle this easily...
This is just one of the many shortcomings.

Ok, back to Zorro laugh
Here we urgently need some reply on how to correctly implement the API functions.
What is also not so good is that Zorro queries ticks, instead of getting them pushed by default.
This means that the tick history of Zorro is very different to the brokers history with many missed ticks.
That makes comparison of tick based backtests impossible.

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475803
01/08/19 15:02
01/08/19 15:02
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted By: ibne
What is also not so good is that Zorro queries ticks, instead of getting them pushed by default.
This means that the tick history of Zorro is very different to the brokers history with many missed ticks.
That makes comparison of tick based backtests impossible.
It is not impossible... in fact, I get every tick in my plugin:
https://github.com/AndrewAMD/SierraChartZorroPlugin

To get all ticks, you must implement SET_HWND. You must send a message to Zorro from another thread or process. Then Zorro will go ahead and collect that tick.

Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475808
01/08/19 15:54
01/08/19 15:54
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Hi Andrew,

thanks for reminding me about the HWND function.
Am I right that when calling PostMessage(hWindow, WM_APP + 1, 0, 0) a BrokerAsset call is triggered?
But how does Zorro know which asset was updated with a new tick?
Will Zorro request all prices for all subscribed assets?
And what about the "normal" periodically price requests with BrokerAsset, are they then stopped?
If not, then ticks might fetched more then once which seems a bit of an overkill.
This is all very unclear to me...

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475809
01/08/19 16:09
01/08/19 16:09
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Calling the windows handle will make zorro call all subscribed assets.

Perhaps it is overkill, but if you're streaming your data, then you already have the data in-memory.

For the other questions, ask jcl.

EDIT: Clarity and correctness

Last edited by AndrewAMD; 01/08/19 16:14.
Re: Some questions for BrokerAPI(1.96.4) [Re: AndrewAMD] #475810
01/08/19 16:22
01/08/19 16:22
Joined: Dec 2014
Posts: 56
I
ibne Offline OP
Junior Member
ibne  Offline OP
Junior Member
I

Joined: Dec 2014
Posts: 56
Andrew, your plugin is written in native C/C++, which is a big advantage over plugins which relay on JVM languages.
Dukascopy is using Java and so we end up with a very high latency regarding tick fetching, because we must use a Java to C/C++ bridge.
I think that the most useful solution would be that Zorro provides update methods which get called by the plugin.
Currently it is the other way round frown

Re: Some questions for BrokerAPI(1.96.4) [Re: ibne] #475811
01/08/19 16:32
01/08/19 16:32
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
You do also have the option of writing a bridge in Java, and have your plugin communicate with it. The java bridge would be a server to zorro and a client to the broker.

This way, you can:
* Have the Java bridge send PostMessage, and
* Both the plugin and the bridge can be single-threaded (usually ideal)
* Have a native C++ plugin.

If you're not sure which protocol to use between the two, just use the DTC protocol and recycle my plugin. laugh

Rationale is similar to what you see here:
https://www.sierrachart.com/index.php?page=doc/helpdetails76.html

(Mind you, these people have strong opinions, but I share some sentiment.)

Page 3 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