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 (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 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
Multi-timeframe Prices #488483
12/19/24 21:42
12/19/24 21:42
Joined: Dec 2024
Posts: 4
F
FXSurgeon Offline OP
Guest
FXSurgeon  Offline OP
Guest
F

Joined: Dec 2024
Posts: 4
Hi,
I am really struggling to understand how to fetch prices from multiple timeframes, especially on a new bar from another timeframe (Daily).
I have the following code:

Code
function run()
{
BarPeriod = 15;
TimeFrame = 1;
// do something every M15 bar

TimeFrame = 96;
printf("\nPrevious Day High=%.5f", dayHigh(UTC,1));
}


It produces incorrect results for previous day high. Any ideas how to handle this?

Re: Multi-timeframe Prices [Re: FXSurgeon] #488660
03/15/25 23:33
03/15/25 23:33
Joined: Apr 2020
Posts: 14
Germany
M
M_D Offline
Newbie
M_D  Offline
Newbie
M

Joined: Apr 2020
Posts: 14
Germany
Hi FXSurgeon,

dayHigh/dayLow:
"Returns the open, close, high, low, and pivot point within the market hours (by default, 9:30 am until 16:00 pm) of a given working day and time zone."

BarZone = UTC;
StartMarket = 0005; //for dayHigh/low define start of market
EndMarket = 2355; // ... end the close of market
BarPeriod = 5;

Not sure if you could set both (StartMarket/EndMarket) to 0000, in any case take care that BarPeriod "hits" the given Start and End of the Market. Had before a different issue where other times were given (example: lets assume the same 0005) but my Barperiod (=15;) did not meet the exact given time, so my functions did not get triggered.
Maybe thats not valid for dayHigh/-Low, just test it.

Edit: for dayHigh/Low you dont need to use TimeFrame ! How to use timeframe is showed in workshop 4.
There you see 2 functions above run(). the first has Timeframe =4, which means "take the barperiod within run and multiplicate with 4". In run is used BarPeriod = 60 (1 hour), so the function with Timeframe 4 works on 4 hour bars.




Last edited by M_D; 03/15/25 23:49.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1