Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 600 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: About marketVol() function [Re: pascalx] #469173
11/07/17 09:24
11/07/17 09:24
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
MT4 delivers no volume, and cannot deliver it since it's mainly a Forex and CFD trading program. Forex and CFD have no volume. You confuse that with the tick frequency.

You can see that it's really the tick frequency when you display marketVol() on EUR/USD live with an MT4 connection, and at the same time observe the ticks in the MT4 terminal. That's why the manual mentions "tick frequency" for MT4 marketVol, not "Volume". And no, there's no historical spread by MT4 either, at least as to my knowledge.

Re: About marketVol() function [Re: jcl] #469179
11/07/17 12:24
11/07/17 12:24
Joined: Aug 2017
Posts: 58
P
pascalx Offline OP
Junior Member
pascalx  Offline OP
Junior Member
P

Joined: Aug 2017
Posts: 58
Originally Posted By: jcl
MT4 delivers no volume, and cannot deliver it since it's mainly a Forex and CFD trading program. Forex and CFD have no volume. You confuse that with the tick frequency.

You can see that it's really the tick frequency when you display marketVol() on EUR/USD live with an MT4 connection, and at the same time observe the ticks in the MT4 terminal. That's why the manual mentions "tick frequency" for MT4 marketVol, not "Volume". And no, there's no historical spread by MT4 either, at least as to my knowledge.

Hi. Yes I might be mistaken on this matter.

A quick google search indeed revealed that the functionality labeled as "volume" in MT4 returns a tick frequency.

Still there appears to be spread information according to the MT4 manual, at least for live feeds. Why is that not bridged?

I will ask a buddy who has great experience with MT4 and forward his assessment on this matter - if he has any.

Do you have opinions about the other 3 issues I mentioned?

Re: About marketVol() function [Re: pascalx] #469181
11/07/17 12:37
11/07/17 12:37
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I do not really understand the spread issue. All brokers deliver live spread and it's available in the "Spread" variable. marketVal is for an arbitrary additional parameter, not necessarily for spread.

As to retrieving more than 2 additional parameters from the broker - can you give me an example of which other parameters from which broker you would need?

Re: About marketVol() function [Re: jcl] #469233
11/09/17 10:08
11/09/17 10:08
Joined: Aug 2017
Posts: 58
P
pascalx Offline OP
Junior Member
pascalx  Offline OP
Junior Member
P

Joined: Aug 2017
Posts: 58
Originally Posted By: jcl
I do not really understand the spread issue. All brokers deliver live spread and it's available in the "Spread" variable. marketVal is for an arbitrary additional parameter, not necessarily for spread.

As to retrieving more than 2 additional parameters from the broker - can you give me an example of which other parameters from which broker you would need?

Ok the spread makes sense. I don't have an example for more than 2 additional parameters. It might be no practical issue, and just a theoretic one, considering we are asking that question and are not sure of the answer. Ideally we would not have to ask that question.

Ok down to 2 issues/questions. Any opinions on points 1 and 4 ?

1. Cannot access/use optional asset data values with BarPeriod > 1 (e.g. when backtesting .t6 data)
2. Cannot retrieve volume and spread with MT4/MT5 (no issue)
3. Limit of 2 optional asset data values. Cannot use 3 or more (no practical issue)
4. marketVol/marketVal might not be what they pretend to be / user has to find out / adapt code to different use cases

Re: About marketVol() function [Re: pascalx] #469247
11/09/17 16:23
11/09/17 16:23
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
To 1., I'm not sure that I understand the problem - can you give an example?

To 4., you can find the returned data by any specific API on the API page in the manual.

Re: About marketVol() function [Re: jcl] #469248
11/09/17 16:56
11/09/17 16:56
Joined: Aug 2017
Posts: 58
P
pascalx Offline OP
Junior Member
pascalx  Offline OP
Junior Member
P

Joined: Aug 2017
Posts: 58
Originally Posted By: jcl
To 1., I'm not sure that I understand the problem - can you give an example?

In the opening post of this topic I added a sample script that shows the problem. When looking into the actual t6 data (with ZHistory tool) then it becomes obvious that the given values are unexpected.

Originally Posted By: jcl
To 4., you can find the returned data by any specific API on the API page in the manual.

Yes. Unfortunately not all pages show this information.

The following do:
http://zorro-trader.com/manual/en/mt4plugin.htm
http://zorro-trader.com/manual/en/oanda.htm
http://zorro-trader.com/manual/en/fxcm.htm
http://zorro-trader.com/manual/en/ib.htm

And these do not:
http://zorro-trader.com/manual/en/ig.htm
http://zorro-trader.com/manual/en/ally.htm
http://zorro-trader.com/manual/en/dukascopy.htm
http://zorro-trader.com/manual/en/nxcore.htm

But as I said earlier this could easily be improved by providing functions that really return what they claim to return.

For example instead of a marketVol(int) function you could have a marketTickFrequency(int) and marketVolume() function that internally are aware if they return what they promise.

For example

Code:
void marketVolume(int offset)
{
	if (plugin == ig || assetData == t6)
	{
		return volume[offset];
	}
	return 0;
}



Otherwise the user needs to implement and maintain such checks himself (if he needs them).

Last edited by pascalx; 11/09/17 16:57.
Re: About marketVol() function [Re: AndrewAMD] #469750
12/06/17 13:18
12/06/17 13:18
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
* -1: Absolute-point-of-reference number of ticks.
* 1: Absolute-point-of-reference number of lots traded.

jcl,

I should offer some clarification on how I expect this to work.

Zorro should anticipate that the absolute point of reference volume should occasionally reset. For example, the DTC protocol defines volume as "volume for this session". If, in this case, the connection is lost and must restart, volume will probably return to zero.

Pseudo-code:
if (AbsVolume[0] < AbsVolume[1]) VolumeSinceLastBrokerAssetCall = 0;

Re: About marketVol() function [Re: AndrewAMD] #469751
12/06/17 13:30
12/06/17 13:30
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes. The point of reference can be anything. It is normally of no importance, IB has not even documented it.

If the broker returns accumulated volume, you can convert it to volume per minute in this way:

VolumePerMinute = (marketVol(0)-marketVol(1))/BarPeriod;

Re: About marketVol() function [Re: jcl] #469752
12/06/17 14:23
12/06/17 14:23
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
jcl,

I saw this in the beta trading.h headers:
Code:
#define GET_PRICETYPE	150 // type of prices returned by the API
#define SET_PRICETYPE	151 
#define GET_VOLTYPE	152 // type of volume returned by the API
#define SET_VOLTYPE	153

As of this writing these are not documented - I look forward to it.

I assume that if I supply absolute or relative volume from the plugin, Zorro will already know how to translate this into the appropriate volume.

For example, if a user's historical volume is volume at that bar, and the plugin provides volume since the last brokerasset call, I expect Zorro to accumulate volume for every given bar. Are my expectations correct?

Re: About marketVol() function [Re: AndrewAMD] #469754
12/06/17 16:10
12/06/17 16:10
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
No, the marketVol function just returns the volume. It does not modify it in any way.

Page 2 of 3 1 2 3

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