Gamestudio Links
Zorro Links
Newest Posts
How does Zorro handle new strategy/asset?
by jcl
0 seconds ago
Intercept Friday Daily Close
by Dalla
27 minutes 22 seconds ago
Montecarlo statistical mode parameter optimization
by brax
Today at 14:14
New Zorro v1.99.2
by jcl
Today at 14:03
automation
by MINER
Today at 13:37
What are you working on?
by CocaCola
Today at 02:42
About 1M entities!
by txesmi
Yesterday at 14:16
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
13 registered (AndrewAMD, Dalla, kvm, Realspawn, Hredot, mabro41, jenGs, brax, 3 invisible), 193 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Thomas_Thornton, rssflc, mahomed, bondz, Neil_G
18119 Registered Users
Page 1 of 4 1 2 3 4 >
Topic Options
Rate This Topic
#471438 - 03/04/18 13:05 1.79 - Spread and marketVal() in test mode
Sphin Offline
User

Registered: 12/11/13
Posts: 567
Loc: Fuerth, DE
Am I doing something wrong or is the spread in test mode with marketVal() not propperly supported?

Code:
function tick() {
	if(is(TESTMODE))
		Spread = marketVal();
	printf("n%04d-%02d-%02d %02d:%02d:%02.3f, %s: %.5f, Spread: %.5f", year(),month(),day(),hour(),minute(),second(),Asset, priceClose(), Spread);
	}
}

function run() {
  LookBack = 0;
  History = ".t1";
  StartDate = 20180302;
  set(TICKS+LOGFILE);
}


produces following log:
Code:
V 1.797 on Sun 18-03-04 12:56:33
Test: ShowSpread EUR/USD (TICKS) 2018
2018-03-02 01:00:0.033, EUR/USD: 1.22735, Spread: 0.00000
2018-03-02 01:00:0.233, EUR/USD: 1.22734, Spread: 0.00000
2018-03-02 01:00:0.420, EUR/USD: 1.22734, Spread: 0.00000
2018-03-02 01:00:0.996, EUR/USD: 1.22733, Spread: 0.00000
2018-03-02 01:00:1.002, EUR/USD: 1.22731, Spread: 0.00000
2018-03-02 01:00:1.027, EUR/USD: 1.22729, Spread: 0.00000
2018-03-02 01:00:1.043, EUR/USD: 1.22728, Spread: 0.00000
2018-03-02 01:00:1.109, EUR/USD: 1.22729, Spread: 0.00000
2018-03-02 01:00:1.216, EUR/USD: 1.22728, Spread: 0.00000
2018-03-02 01:00:1.308, EUR/USD: 1.22728, Spread: 0.00000


while the corresponding .t1 (in ZHistoryEditor, downloaded from FXCM with assetHistory(Asset,0)):
Code:
2018.03.02 01:00:01.308	1,22728
2018.03.02 01:00:01.308	-1,22727
2018.03.02 01:00:01.215	1,22728
2018.03.02 01:00:01.108	1,22729
2018.03.02 01:00:01.043	1,22728
2018.03.02 01:00:01.026	1,22729
2018.03.02 01:00:01.002	1,22731
2018.03.02 01:00:00.996	1,22733
2018.03.02 01:00:00.996	-1,22732
2018.03.02 01:00:00.419	1,22734
2018.03.02 01:00:00.419	-1,22732
2018.03.02 01:00:00.233	1,22734
2018.03.02 01:00:00.233	-1,22733
2018.03.02 01:00:00.033	1,22735
2018.03.02 01:00:00.033	-1,22733


Top
#471464 - 03/05/18 15:37 Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
The spread of that bar was just 0. This can happen in historical data.

Spread is only stored for bars, not for ticks. So it won't change tick by tick. This is on our list for the next update - spreads will then be stored by tick.

Top
#471467 - 03/05/18 17:39 Re: 1.79 - Spread and marketVal() in test mode [Re: jcl]
Sphin Offline
User

Registered: 12/11/13
Posts: 567
Loc: Fuerth, DE
Quote:
Spread is only stored for bars, not for ticks.
This is exactly what one expects if he read in the manual:
Quote:
If .t1 data contains both ask and bid quotes, marketVal returns the recent ask-bid spread

I would laugh about if I didn't waste much time searching for errors in my code.

Top
#471470 - 03/05/18 18:03 Re: 1.79 - Spread and marketVal() in test mode [Re: jcl]
AndrewAMD Online
Senior Member

Registered: 02/21/17
Posts: 480
Loc: Chicago
Originally Posted By: jcl
This is on our list for the next update - spreads will then be stored by tick.
Will plugins be needing to support a new tick struct? Or will Zorro simply interpret the T1 data differently?

Top
#471473 - 03/05/18 19:20 Re: 1.79 - Spread and marketVal() in test mode [Re: AndrewAMD]
Sphin Offline
User

Registered: 12/11/13
Posts: 567
Loc: Fuerth, DE
The .t1 files contains positive (ask) and negative values (bid). The ask can be accessed with priceClose(). If there was a chance to access the bid one could calculate the spread himself I think.

Top
#471488 - 03/06/18 09:43 Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
Plugins need not be changed, it is an internal Zorro function. The .t1 file is not directly stored, so you have no direct access to the bid. You could load it in parallel in a dataset and evaluate it, but better wait for the Zorro implementation. It won't take long.

Top
#471598 - 03/10/18 19:48 Re: 1.79 - Spread and marketVal() in test mode [Re: jcl]
Sphin Offline
User

Registered: 12/11/13
Posts: 567
Loc: Fuerth, DE
Will there be a notice in What's new if it is realized?

Top
#471634 - 03/12/18 10:16 Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
Yes, it will.

Top
#471670 - 03/13/18 18:45 Re: 1.79 - Spread and marketVal() in test mode [Re: jcl]
Sphin Offline
User

Registered: 12/11/13
Posts: 567
Loc: Fuerth, DE
Great!

BTW: I tried to work around using a BarPeriod of 1./60 and learned that it is useless setting it lower than one hour concerning to the spread. But Zorro reacted generally very angry to this attempt, it mixes up times (time of the end of the trade is before its start and not even of the bar period) and also the 10,000-times-higher-due-to-the-Forex-multiplicator problem appeared again (1.79.8):
Quote:
[95: Mon 18-02-26 01:34:04] 0000 -1200 0/2 (1.39684)....
[EURUSD_B1::S9601] Short 1@1.22998 at 01:36:00
[EURUSD_B2::L9602] Long 1@1.23001 at 01:36:00
[EURUSD_B2::L9602] Sell 1@1.22999: -600 at 01:35:01
[EURUSD_B1::S9601] Cover 1@1.22989: -600 at 01:35:01

[96: Mon 18-02-26 01:35:03] -1200 -1354 1/3 ....

Maybe those BarPeriods are not for broker arbitrage scripts?

Top
#471677 - 03/14/18 10:03 Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
Possibly, but I suppose that the problem is caused by many empty bars with no quotes inside. Can you contact Support with that script? They'll look into it.

Top
Page 1 of 4 1 2 3 4 >



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

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