Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, alibaba, 3run), 15,721 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 70
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 70
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,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
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