Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Imhotep), 567 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
1.79 - Spread and marketVal() in test mode #471438
03/04/18 12:05
03/04/18 12:05
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
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


Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin] #471464
03/05/18 14:37
03/05/18 14:37
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

Re: 1.79 - Spread and marketVal() in test mode [Re: jcl] #471467
03/05/18 16:39
03/05/18 16:39
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
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.

Re: 1.79 - Spread and marketVal() in test mode [Re: jcl] #471470
03/05/18 17:03
03/05/18 17:03
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
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?

Re: 1.79 - Spread and marketVal() in test mode [Re: AndrewAMD] #471473
03/05/18 18:20
03/05/18 18:20
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
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.

Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin] #471488
03/06/18 08:43
03/06/18 08:43
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

Re: 1.79 - Spread and marketVal() in test mode [Re: jcl] #471598
03/10/18 18:48
03/10/18 18:48
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Will there be a notice in What's new if it is realized?

Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin] #471634
03/12/18 09:16
03/12/18 09:16
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, it will.

Re: 1.79 - Spread and marketVal() in test mode [Re: jcl] #471670
03/13/18 17:45
03/13/18 17:45
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline OP
User
Sphin  Offline OP
User

Joined: Dec 2013
Posts: 568
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?

Re: 1.79 - Spread and marketVal() in test mode [Re: Sphin] #471677
03/14/18 09:03
03/14/18 09:03
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.

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