Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (dBc), 17,982 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 10
Germany
M
M_D Offline
Newbie
M_D  Offline
Newbie
M

Joined: Apr 2020
Posts: 10
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