Hi Aaliyan,
You are not using the inbuilt modules correctly. To start off I would suggest reading both these articles, and studying the code provided within:
https://www.mql5.com/en/articles/226
https://www.mql5.com/en/articles/367
They will give you an understanding of how to create an EA with the wizard, and use the LongCondition/ShortCondition methods.
- 2011.01.11
- MetaQuotes Software Corp.
- www.mql5.com
Hi everyone,
I have a small problem if anyone can help me, i build an EA with MQL5Wizard and i would like display the sum of pattern result of my signal.(Short and LongCondition result exactly)
...
I know it's an old topic, but it's not really answered...
To print the value of ShortCondition/LongCondition for a signal module, you simply have to declare your filter0 (or filter1, filter2...) as global variable. I take the example of an EA build with the Wizard and based on SignalMA. Inside OnInit() function you have:
int OnInit() { ... //--- Creating filter CSignalMA CSignalMA *filter0=new CSignalMA; ... }
You have to change this a little :
CSignalMA *filter0; int OnInit() { ... //--- Creating filter CSignalMA filter0=new CSignalMA; ... }
Then you can print the needed values in OnTick() :
void OnTick() { ExtExpert.OnTick(); Print("filter 0 : Long= ",filter0.LongCondition(), " Short= ", filter0.ShortCondition()); }
That give you :
2013.10.02 11:02:58 testMA (EURUSD,M5) filter 0 : Long= 80 Short= 0
Interesting, and good information to boot.
Thank you for this discussion.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I have a small problem if anyone can help me, i build an EA with MQL5Wizard and i would like display the sum of pattern result of my signal.(Short and LongCondition result exactly)
In my Ontick function, i test this, but i have an error (folder0 is unknow):
And if i declare my signal objet in OnTick (CSignalSAR *filter0=new CSignalSAR;) filter0.LongCondition return always 0...
Have you an idea.
Thanks in advance.
(I'm a french MQL5 beginner developper, so forgive me for my English very light)
Aaliyan