How to get previous day "High" in EOD time frame from an intraday 5 min. time frame

Hello everybody;
I am a novice and I’m trying to develop a simple trading system with 5 min. time frame that enter the trade when the High of a bar is greater than the High
of the previous day in daily time frame. I’ve read the tutorial “Multiple Time Frame support in AFL” but i don’t understand how it works in this case.
Here and excerpt from my code:

for( i = 1; i < BarCount; i++ )


	PreviousMax = Ref(H,-1);


	if (H[ i ] > PreviousMax) then
		Setup = 1;
		Buy[ i ] = True;
		priceatbuy = BuyPrice[ i ];
		//and so on...

Obviously, This code give me only the value of the previous day of the last daily bar of the entire period but I want to get the value of every single
"previous day" of the period I’m analysing.
Thus, the question is: how can I keep in touch the High value of a 5 min. bar in a day with the corresponding High (daily) of the day before?

Thanks in advance for any suggestion.

Good trading to everyone!

No you did not. Reading is not the same as “scanning”. Reading is more than just looking at text. Reading is about UNDERSTANDING. People nowadays don’t read. They scan text.

The code is completely wrong. TimeFrameSet must NOT be used inside loop. If your read the manual first you would find out that what you are trying to do is documented in manual and requires SINGLE LINE of code

// gives previous Day High when working on intraday data
prevmax = TimeFrameGetPrice( "H", inDaily, -1 );

This is verbatim copy from Users’ guide:

Bottom line: start READING the docs carefully and possibly MANY TIMES until it sinks! Literally EVERYTHING is covered in documentation. AmiBroker documentation is CONCISE. Every word and every sentence is important.

Another essential reading is:

Thank You Tomasz, I will study the tutorial and then I’ll return on this topic if necessary.

Best regards.

@RockerGab try these


prevmaxM5 = TimeFrameGetPrice( "H", 300, -1 );

printf( " \n " );
printf( " prevmax M5 = " +prevmaxM5 );
printf( " \n " );

prevmaxM10 = TimeFrameGetPrice( "H", 600, -1 );

printf( " \n " );
printf( " prevmax M10 = " +prevmaxM10 );
printf( " \n " );

prevmaxM30 = TimeFrameGetPrice( "H", 1800, -1 );

printf( " \n " );
printf( " prevmax M30 = " +prevmaxM30 );
printf( " \n " );