Gamestudio Links
Zorro Links
Newest Posts
phantom() not defined in indicators.c
by AndrewAMD. 08/05/26 17:49
Pause button for evaluation shell?
by AndrewAMD. 08/05/26 13:42
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,784 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19222 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: 79
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

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

Chief Engineer
jcl  Offline

Chief Engineer

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