https://www.mql5.com/en/forum/106952
https://www.mql5.com/en/forum/106952
https://www.mql5.com/en/search ... used to find answers.
I really can't figure it out. And i did search a lot. Mainly because of the fact MT4 should have several limitations, i.e.:
- Can't use WindowFind() function while testing
- SetIndexBuffer don't appear to work within an EA?
The solution you pointed to:
if(IsTesting() && !IsVisualMode() ) {} // note: no indy object create while backtesting w/o VisualMode, if visual testing make sure indy on visual tester template else { // [ ObjectCreate CODE.... ] }
Is not working to for me unfortunately, since I still need to use the WindowFind() Function.
Again after a lot of hours I've only seperated them, since it's more overviewable this way and hope you've got any other thoughts.
Any help would be greatly appreciated
Edit: I could also rewrite it, and make it like this, if that's more easier? Thoughts?
double A,B,C; //////////////////////// int init() { // Load indicator values for first loop A=iCCI(TF1Parameters); B=iCCI(TF2Parameters); C=iCCI(TF3Parameters); return(0); } //////////////////////// double CCITimeFrame1() { if(IsNewBarTF1()) A=iCCI(TF1Parameters); return(A); } double CCITimeFrame2() { if(IsNewBarTF2()) B=iCCI(TF2Parameters); return(B); } double CCITimeFrame3() { if(IsNewBarTF3()) C=iCCI(TF3Parameters); return(C); }
A disadvantage would be that I can't see my indicator but I could always ad it manually in case I want to see it, plus it's going to run on a server anyhow. Thoughts?
Freedom102 --> EAFreedom --> Indicator
I really can't figure it out. And i did search a lot. Mainly because of the fact MT4 should have several limitations, i.e.:
- Can't use WindowFind() function while testing
- SetIndexBuffer don't appear to work within an EA?
The solution you pointed to:
Is not working to for me unfortunately, since I still need to use the WindowFind() Function.
But i am calling it per iCustom now(right?), but doesn't appear to work (EA + Ind. were attached to previous post), or I'm misunderstanding you!
Is the alternative I stated ok? Since I only know the basics at this moment. Well probably a bit more, but you can point it that way. And because of that I'm opted (for myself) to go with the flow with the least resistance/that's the most easy one for me. But offcourse I want to learn it, so if you've got some extra additions or what I misinterpreted just tell! Thanks for the replies!
But i am calling it per iCustom now(right?), but doesn't appear to work (EA + Ind. were attached to previous post), or I'm misunderstanding you!
Is the alternative I stated ok? Since I only know the basics at this moment. Well probably a bit more, but you can point it that way. And because of that I'm opted (for myself) to go with the flow with the least resistance/that's the most easy one for me. But offcourse I want to learn it, so if you've got some extra additions or what I misinterpreted just tell! Thanks for the replies!
What I mean with that, is that I keep getting the 'unknown subwindow number -1 for ObjectCreate function'-error every time a new bar is generated.
You don't if you are calling your Indicator from your EA using iCustom . . . all you care about is the buffer values not what Objects are on screen . . . so if the WindowFind() returns -1 don't draw thee Objects.
- Since you can't use WindowFind() on the MT4 Strategy TesterSince when?
- SetIndexBuffer don't appear to work within an EA?Of course not, there are NO indicator buffers in an EA
- But i am calling it per iCustom nowYes you are. You are getting the indicators buffers. BUT the indicator is not attached to the chart - it has no window. Do what RaptorUK suggests. Don't draw things in the indicator's window when it doesn't exist. There's no need to draw anything anyway - EA's have no eyes.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello all,
I'm trying to make an EA which is based on the Freedom Indicator, which on his turn is based on CCI's on multiple timeframes; So in order to go long for instance M15,M30 and H1 should all show an uptrend. This is the first time I used a custom indicator instead of one from the library, and I'm struggling with it a bit. Since you can't use WindowFind() on the MT4 Strategy Tester, I was looking for an alternative, but since I'm not very experienced with this I'm asking you're help, thanks in advance!
The complete code is also added. I've pretty much copypasted the indicator in my template, so that's why you'll probably notice two different styles of writing.