Hi All.
I am using this code
in optimization by genetic I need to use just 2 timeframes:
M1 and M5
How to set it?
One way is to use this code:
AND then in genetic tester optimization use for TF :
start = 1 >> Step =4 >> Stop = 5
BUT:
the indicator gives ERROR :
'TF' - cannot convert enum
because it is not Timeframe.
/////////////////
The solution is :
But, I don't want to use ""int"" or if I had to use int I don't use so many IF's ( Maybe I use more time frames for optimization).
And , I don't want to use ""FUNCTION"" return the TimeFrame.
I know """declaring an enum """ could solve it.
But How? ..
This Code Does'nt work also:
Thanks for help in advance.
input ENUM_TIMEFRAMES TF = PERIOD_M1;it is just an idea...
Hi All.
I am using this code
in optimization by genetic I need to use just 2 timeframes:
M1 and M5
How to set it?
One way is to use this code:
AND then in genetic tester optimization use for TF :
start = 1 >> Step =4 >> Stop = 5
BUT:
the indicator gives ERROR :
'TF' - cannot convert enum
because it is not Timeframe.
/////////////////
The solution is :
But, I don't want to use ""int"" or if I had to use int I don't use so many IF's ( Maybe I use more time frames for optimization).
And , I don't want to use ""FUNCTION"" return the TimeFrame.
I know """declaring an enum """ could solve it.
But How? ..
This Code Does'nt work also:
Thanks for help in advance.
I'm not familiar with genetic algorithms, but you might be able to use an array for timeframes.
This Code Does'nt work also:
enum MyTF { M1 = PERIOD_M1, M5 = PERIOD_M5 }; input MyTF TF = M1;
That is exactly how to do it. Then in the iCustom call cast it to a ENUM_TIMEFRAMES
That is exactly how to do it. Then in the iCustom call cast it to a ENUM_TIMEFRAMES
enum MyTF { M1 = PERIOD_M1, M5 = PERIOD_M5 }; input MyTF TF = M1; //--- Handle = iCustom(NULL,(ENUM_TIMEFRAMES)TF,name);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am using this code
in optimization by genetic I need to use just 2 timeframes:
M1 and M5
How to set it?
One way is to use this code:
AND then in genetic tester optimization use for TF :
start = 1 >> Step =4 >> Stop = 5
BUT:
the indicator gives ERROR :
'TF' - cannot convert enum
because it is not Timeframe.
/////////////////
The solution is :
But, I don't want to use ""int"" or if I had to use int I don't use so many IF's ( Maybe I use more time frames for optimization).
And , I don't want to use ""FUNCTION"" return the TimeFrame.
I know """declaring an enum """ could solve it.
But How? ..
This Code Does'nt work also:
Thanks for help in advance.