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
2 registered members (AndrewAMD, TipmyPip), 32,306 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
Hourly bars / Daily prices #479812
04/27/20 17:26
04/27/20 17:26
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Hi all,
could someone help me to implement the following?
I want my trades to be executed every day at 1 am based on the daily (midnight) bars prices.

Code
string datetime(){
	return strf("%02d.%02d.%02d %02d:%02d:%02d %d",day(),month(),year(),hour(),minute(),(int)second(),dow());
}


function run()
{
set(LOGFILE);
LookBack = 0;
BarPeriod = 60;
assetList("AssetsFix");
StartDate = 20200410;

asset("EUR/USD");

TimeFrame = 1;
FrameOffset = 0;
var open = priceOpen();
var close = priceClose();
printf("\n%s | Open=%.5f, Close=%.5f", datetime(), open, close);

TimeFrame = 24;
FrameOffset = 1;
var open = priceOpen();
var close = priceClose();
if(hour()==1) printf(" | Open=%.5f, Close=%.5f", open, close);

}



I thought I could use FrameOffset, but it didn't get the expected result.
I'm not sure I understood what FrameOffset does exactly. Changing its value seems to make no difference at all.

[Linked Image]

What I want, is to get the green prices and not the red ones.
Can you please help me?
Is there a more correct way to set BarPeriod/TimeFrame in order to get the result??

Thanks!!!

Re: Hourly bars / Daily prices [Re: kerplunk1899] #479814
04/27/20 18:31
04/27/20 18:31
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Code

string datetime(){
	return strf("%02d.%02d.%02d %02d:%02d:%02d %d",day(),month(),year(),hour(),minute(),(int)second(),dow());
}


function run()
{
set(LOGFILE);
LookBack = 0;
assetList("AssetsFix");
StartDate = 20200410;
BarPeriod = 60;

TimeFrame = 1;
FrameOffset = 0;
printf("\n%s | open=%.5f - close=%.5f", datetime(), priceOpen(), priceClose());

TimeFrame = 24;
FrameOffset = 17;
vars open = series(priceOpen());
vars close = series(priceClose());

if(hour()==1) printf(" | open=%.5f - close=%.5f", open[0], close[0]);


}



It seems this way I obtain what I want, but can you explain me why??
Why FrameOffset should be equals to 17?
Is is because of the default value of BarOffset (1000)?

Last edited by kerplunk1899; 04/27/20 18:32.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1