Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (clonman, VoroneTZ, M_D, TipmyPip, AndrewAMD), 10,202 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 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,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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