Please ask all Zorro Trader questions in the Zorro Trader forum. You need to sign up first.
Quote from fxsurgeon on November 2, 2024, 9:37 amI am relatively new to Zorro, coming from MQL4/5.
Studying the basics (like BarPeriod, TimeFrame, frameSync, etc) has not proven to elevate my understanding on how exactly Zorro delivers price data.
To complicate the matter, my trading system makes decisions at different timeframes and executes at different timeframes, for example M15 and D1.
So, how in the world do I make decisions at the M15 level in relation to D1 price levels in Zorro?
I will be very grateful to anyone who can explain this. Thank you!
I am relatively new to Zorro, coming from MQL4/5.
Studying the basics (like BarPeriod, TimeFrame, frameSync, etc) has not proven to elevate my understanding on how exactly Zorro delivers price data.
To complicate the matter, my trading system makes decisions at different timeframes and executes at different timeframes, for example M15 and D1.
So, how in the world do I make decisions at the M15 level in relation to D1 price levels in Zorro?
I will be very grateful to anyone who can explain this. Thank you!
Quote from Algo Mike on November 25, 2024, 5:51 pmHi fxsurgeon and welcome to the forum!
Here's a link to a very simple example of using two different time frames in Zorro Trader:
https://zorro-project.com/manual/en/tutorial_kelly.htm
Please note that in their script, the BarPeriod is 60 minutes. In the tradeCounterTrend() function, the internal Zorro Trader variable TimePeriod is used, and set to 4 (meaning four hourly bars, thus 4 hours). In the tradeTrend() function, the same variable is used to set an hourly time frame for this second trading strategy. This is, at the most basic level, how you would use two different time frames in the same strategy.
If you have specific questions, or code that does not work correctly, please post here.
Hi fxsurgeon and welcome to the forum!
Here's a link to a very simple example of using two different time frames in Zorro Trader:
https://zorro-project.com/manual/en/tutorial_kelly.htm
Please note that in their script, the BarPeriod is 60 minutes. In the tradeCounterTrend() function, the internal Zorro Trader variable TimePeriod is used, and set to 4 (meaning four hourly bars, thus 4 hours). In the tradeTrend() function, the same variable is used to set an hourly time frame for this second trading strategy. This is, at the most basic level, how you would use two different time frames in the same strategy.
If you have specific questions, or code that does not work correctly, please post here.
Quote from fxsurgeon on December 3, 2024, 3:13 amThank you Algo Mike for the explanation and the example.
How about fetching D1 price information (say current Day High and Low) at a certain time of the day? In which function should this happen?
Thank you Algo Mike for the explanation and the example.
How about fetching D1 price information (say current Day High and Low) at a certain time of the day? In which function should this happen?
Quote from Mustafa Durmaz on December 4, 2024, 9:14 amHi fxsurgeon,
If you git the current Version of zorro, there are already dayhigh and Daylow Functions. Open help document, click search tab, type "dayhigh".
Hi fxsurgeon,
If you git the current Version of zorro, there are already dayhigh and Daylow Functions. Open help document, click search tab, type "dayhigh".
Quote from fxsurgeon on December 15, 2024, 11:41 amQuote from Mustafa Durmaz on December 4, 2024, 9:14 amHi fxsurgeon,
If you git the current Version of zorro, there are already dayhigh and Daylow Functions. Open help document, click search tab, type "dayhigh".
I did some tests with dayHigh, dayLow, etc. functions. I can't get them to work as intended. Here is some code to illustrate the issue:
function run()
{
BarPeriod=15;// Daily TF
TimeFrame = 96;
vars highs = series(priceH(),3);
vars lows = series(priceL(),3);TimeFrame = 1;
// Original timeframe routines go below
At the daily timeframe run I fetch some daily price series. However, if I didn't use "TimeFrame=96" and instead used only "dayHigh" and "dayLow", I would not get the same daily prices.
Any ideas?
Quote from Mustafa Durmaz on December 4, 2024, 9:14 amHi fxsurgeon,
If you git the current Version of zorro, there are already dayhigh and Daylow Functions. Open help document, click search tab, type "dayhigh".
I did some tests with dayHigh, dayLow, etc. functions. I can't get them to work as intended. Here is some code to illustrate the issue:
function run()
{
BarPeriod=15;// Daily TF
TimeFrame = 96;
vars highs = series(priceH(),3);
vars lows = series(priceL(),3);TimeFrame = 1;
// Original timeframe routines go below
At the daily timeframe run I fetch some daily price series. However, if I didn't use "TimeFrame=96" and instead used only "dayHigh" and "dayLow", I would not get the same daily prices.
Any ideas?
Quote from fxsurgeon on December 18, 2024, 6:37 pmGuys, I really don't understand how this works. Have a look at the following code:
function run()
{
BarPeriod = 15;
TimeFrame = 1;
// do something every M15 barTimeFrame = 96;
printf("\nPrevious Day High=%.5f", dayHigh(UTC,1));
}It throws some IDX error, LookBack seems insufficient but when I explicitly set it, it seems never enough.
Also, the statements after "TimeFrame=96" don't seem to execute once every 24 hours.
"dayHigh" doesn't really fetch the correct price of the previous day.
Very frustrating...
Guys, I really don't understand how this works. Have a look at the following code:
function run()
{
BarPeriod = 15;
TimeFrame = 1;
// do something every M15 barTimeFrame = 96;
printf("\nPrevious Day High=%.5f", dayHigh(UTC,1));
}
It throws some IDX error, LookBack seems insufficient but when I explicitly set it, it seems never enough.
Also, the statements after "TimeFrame=96" don't seem to execute once every 24 hours.
"dayHigh" doesn't really fetch the correct price of the previous day.
Very frustrating...