Gamestudio Links
Zorro Links
Newest Posts
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
Capital slider is not saving in Z12
by frutza. 09/17/26 13:36
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
What are you working on?
by rayp. 09/16/26 20:20
Future of ZorroHFT
by TipmyPip. 09/16/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,248 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
lopezsergio07, mistery, lokkalyansamiti, rahulbuilds, speedx
19237 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
assetHistory one candle shift #488884
09/11/25 17:44
09/11/25 17:44
Joined: Jan 2022
Posts: 81
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 81
Budapest
Hello,

I am using assetHistory function to download the candle data especially from my broker.
Sample script for downloading:

Code
#include <zorro.h>

const int y = 2025;
const char* a = "GER40.cash";
const int resolution = 15;

DLLFUNC void main(){
    printf("Starting data download for %s for the year %d with %d minute resolution.\n", a, y, resolution);
    Verbose = 3;
    LookBack = 0;
    StartDate = y * 10000 + 101;
    EndDate = y * 10000 + 1231;
    LookBackResolution = resolution;
    assetHistory(a, 4);
}


I use this with MT4 bridge.
However, as we see, there is one candle shift in the downloaded data.

at the .t6 history file:
4:45 open: 23594,26
at my broker:
4:30 open: 23594,26

So the data is the same, but the time is shifted with one candle. Note that my borker server time is not in CET, but it's easy to spot because of the full hours. Please check the attached pictures:
  • 445.png: data in .t6 file
  • 430.png, 430_2.png: the actual data at the broker


Do you have any clue what I did wrong?

Attached Files 445.png430_2.png430.png
Re: assetHistory one candle shift [Re: NorbertSz] #488917
09/21/25 11:36
09/21/25 11:36
Joined: Jul 2000
Posts: 28,133
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,133
Frankfurt
Possibly the prices are stored on the broker server with timestamps belonging to the begin instead of the end of the bar, while live prices have a end of bar timestamp. This is not very visible with M1 data, but on 15 min data it can become obvious. Use the TickFix variable for fixing the lookback data on the fly.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1