I did the custom shifting because the automatic shifting (as suggested in the example codes in TimeFrame help) did exactly the same. And because I did not understand why it does, I tried to "implement", but same results. So the following code, the automatic shifting acts just exactly the previously posted:

Code
function run(){

    BarPeriod = 1;
    LookBack = 240*100;
    StartDate = 20100101;
    EndDate = 20100201;

    asset("EURUSD");

    TimeFrame = 1;
    vars priceM1 = series(priceClose(), 100);
    TimeFrame = 5;
    vars priceM5 = series(priceClose(), 100);

    if (!is(LOOKBACK)){
        int i, j;
        for (i=0; i<10; i++){
            printf("\n--- M5: %.5f", priceM5[i]);
            for (j=0; j<5; j++){
                printf("\n M1: %.5f", priceM1[i*5+j]);
            }
        }
        quit(0);
    }
}

Last edited by NorbertSz; 09/06/22 18:23.