Posted By: TipmyPip
Multi Timeframe support. - 03/25/19 20:15
Does anyone know if Zorro supports multi-timeframe experts?
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/25/19 20:23
Yes, you can learn about it in the Zorro tutorial. It's a recommended read.
Posted By: TipmyPip
Re: Multi Timeframe support. - 03/27/19 05:40
Thank you. But can you share with me the link to the page in the tutorial? thank you.
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/27/19 13:31
Posted By: TipmyPip
Re: Multi Timeframe support. - 03/27/19 18:25
Thank you very much for your help,
But that was my problem.
Those scripts work with different assets in different timeframes.
I was trying to use those scripts with one asset in two different timeframes, and don't get it to work. Do you have any ideas?
Thank you.
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/27/19 19:02
It's the same exact thing, except you have the same asset.
If you're confused, post your script.
Posted By: TipmyPip
Re: Multi Timeframe support. - 03/29/19 03:24
I am sure you know programming,
I have a small challenge for you.
Please do try to write a small script even with just one indicator like MA.
But try to have four conditions in it which are two for each timeframe and use the 4-hour and the 5-minutes timeframe,
I will make it easy for you -
1. 4HMA13 > 4HMA34 & 5MMA13 > 5MMA34 THEN BUY
4HMA13 > 4HMA34 & 5MMA13 == 5MMA34 THEN CLOSE
2. 4HMA13 < 4HMA34 & 5MMA13 < 5MMA34 THEN SELL
4HMA13 < 4HMA34 & 5MMA13 == 5MMA34 THEN CLOSE
Was that easy?
Thank you.
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/29/19 10:13
Easy? Yes. Do I have time for this? No.
I do have time to criticize code.
Posted By: TipmyPip
Re: Multi Timeframe support. - 03/29/19 17:24
Well, if you would be a programmer, then you would be able to think logically.
If you can criticize, I suppose you know to read and understand code, as well as write it. But we are not here for a competition. We are here to help each other. Can you help me, please? or you rather find someone clever as you are, and compete with them.
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/29/19 18:08
But I already helped you. So help me help you.
Post code.
Posted By: TipmyPip
Re: Multi Timeframe support. - 03/30/19 11:34
#define M5 (5*BarPeriod)
#define M1 (BarPeriod)
function run()
{
Capital = 5000;
Margin = 0.1;
BarPeriod = 1;
NumWFOCycles = 10; // activate WFO, 10 cycles
TimeFrame = M5;
vars PriceM5 = series(price());
vars TrendM5 = series(LowPass(PriceM5,1000));
vars SignalsM5 = series(0);
TimeFrame = M1;
vars PriceM1 = series(price());
vars TrendM1 = series(LowPass(PriceM1,1000));
vars SignalsM1 = series(0);
Stop = 4*ATR(100);
FuzzyRange = 0.001*ATR(100);
var Valley = valleyF(TrendM1),
Peak = peakF(TrendM1);
SignalsM1[0] = orF(Valley,Peak); // store the signal
SignalsM5[0] = orF(Valley,Peak); // store the signal
if(fuzzy(Valley))
exitShort();
if(fuzzy(andF(Valley,notF(Sum(SignalsM1+1,3)))))
enterLong();
if(fuzzy(Peak))
exitLong();
if(fuzzy(andF(Peak,notF(Sum(SignalsM5+1,3)))))
enterShort();
}
Posted By: AndrewAMD
Re: Multi Timeframe support. - 03/30/19 17:23
This approach appears correct on the surface, but why are you not making any use of the TrendM5 series? It defeated the purpose of changing the timeframe.