2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
User
|
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?
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:
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)):
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: jcl]
#471467
03/05/18 16:39
03/05/18 16:39
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
Spread is only stored for bars, not for ticks. This is exactly what one expects if he read in the manual: 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,731 Chicago
AndrewAMD
Serious User
|
Serious User
Joined: Feb 2017
Posts: 1,731
Chicago
|
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: Sphin]
#471634
03/12/18 09:16
03/12/18 09:16
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
|
|
|
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
OP
User
|
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): [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?
|
|
|
|