|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Alternating, different closes in different BarPeriods
#463453
12/04/16 23:27
12/04/16 23:27
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
It seems that priceClose()s for the same date at the same time with the same history files (.t6) are alternating through the BarPeriods:
e.g. EUR/USD:
BarPeriod: 1440/120/30/10/1:
[..: Tue 06.01.09 00:00] (1.39578)priceClose: 1.36299
[..: Wed 07.01.09 00:00] (1.36299)priceClose: 1.34973
BarPeriod: 240/60/15/5
[..: Tue 06.01.09 00:00] (1.36020)priceClose: 1.36376
[..: Wed 07.01.09 00:00] (1.35201)priceClose: 1.35070
e.g. EUR/GBP:
BarPeriod: 1440/120/30/10/1:
[..: Tue 06.01.09 00:00] (0.96152)priceClose: 0.92680
[..: Wed 07.01.09 00:00] (0.92680)priceClose: 0.90537
BarPeriod: 240/60/15/5:
[..: Tue 06.01.09 00:00] (0.92382)priceClose: 0.92690
[..: Wed 07.01.09 00:00] (0.90520)priceClose: 0.90598
Are there rules which priceClose() is taken in which BarPeriod and how to convert them (deviation in this example between 1 and 10 PIPs)? Comparing strategies in different BarPeriods is just a bit hard this way. Thanks, Sphin P.S.: 1.52.0 without LEAN of course
|
|
|
Re: Alternating, different closes in different BarPeriods
[Re: jcl]
#463465
12/05/16 19:02
12/05/16 19:02
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
I'm not quite sure what to check but I think the highest resolution in .t6 is 1 minute and a tick therefore is a 1-minute-bar. If I let Zorro print the close price each bar in a bar period of 1 I get these prices:
EUR/USD:
[2386: Mon 05.01.09 23:59] (1.36487)priceClose: 1.36376
[2387: Tue 06.01.09 00:00] (1.36376)priceClose: 1.36299
[3817: Tue 06.01.09 23:59] (1.35087)priceClose: 1.35070
[3818: Wed 07.01.09 00:00] (1.35070)priceClose: 1.34973
EUR/GBP:
[2392: Mon 05.01.09 23:59] (0.92733)priceClose: 0.92690
[2393: Tue 06.01.09 00:00] (0.92690)priceClose: 0.92680
[3830: Tue 06.01.09 23:59] (0.90603)priceClose: 0.90598
[3831: Wed 07.01.09 00:00] (0.90598)priceClose: 0.90537
Here it is noticeable that in BarPeriods 240/60/15/5 the close price of 00:00 is set to a value that is regarded as the close price of 23:59 in a bar period of 1. But this is from the point of view of a bar period of 1 of course.
|
|
|
Re: Alternating, different closes in different BarPeriods
[Re: Sphin]
#463471
12/06/16 08:02
12/06/16 08:02
|
Joined: Jul 2000
Posts: 27,935 Frankfurt
jcl

Chief Engineer
|

Chief Engineer
Joined: Jul 2000
Posts: 27,935
Frankfurt
|
Yes. Prices in history files are no bar periods, but single ticks, although with an open, close, high, and low. A tick is valid until the next tick.
If a tick has a time stamp at exactly a hour boundary, it can fall in either the previous or the next bar period, dependent on rounding. In the latter case the bar period ends with the previous tick. At least I would interpret it so.
But I'll let the developer check if it is really so, and modify it so that the same tick is always at the same side of the boundary. It's not relevant for backtests, but nicer.
|
|
|
Re: Alternating, different closes in different BarPeriods
[Re: jcl]
#463482
12/06/16 19:41
12/06/16 19:41
|
Joined: Dec 2013
Posts: 568 Fuerth, DE
Sphin
OP
User
|
OP
User
Joined: Dec 2013
Posts: 568
Fuerth, DE
|
I think it might be relevant for backtests because if I buy and sell at different prices I get different results, is this wrong? Another fact in this context: As shown above the bar periods 1440/120/30/10/1 seem to be in sync but if I buy at 00:00:00 I get different entry prices in all bar periods:
BP: 1440
[8: Thu 15.01.09 00:00] (0.90952)
EUR/GBP priceClose: 0.90367
[EUR/GBP::L0801] Long 1@0.90352 at 00:00:00
BP: 120
[99: Wed 14.01.09 22:00] (0.90226)
[100: Thu 15.01.09 00:00] (0.90288)
EUR/GBP priceClose: 0.90367
[EUR/GBP::L0001] Long 1@0.90372 at 00:00:00
BP: 30
[408: Wed 14.01.09 23:30] (0.90227)
[409: Thu 15.01.09 00:00] (0.90225)
EUR/GBP priceClose: 0.90367
[EUR/GBP::L0901] Long 1@0.90357 at 00:00:00
BP: 10
[1228: Wed 14.01.09 23:50] (0.90241)
[1229: Thu 15.01.09 00:00] (0.90388)
EUR/GBP priceClose: 0.90367
[EUR/GBP::L2901] Long 1@0.90364 at 00:00:00
BP: 1
[12218: Wed 14.01.09 23:59] (0.90410)
[12219: Thu 15.01.09 00:00] (0.90394)
EUR/GBP priceClose: 0.90367
[EUR/GBP::L1901] Long 1@0.90408 at 00:00:00
Is Slippage and Fill's extra Slippage dependant on the bar period? Is there a chance to sync them?
|
|
|
|