[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 627
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Replaced "return(0)" with "return", but this did not solve the "problem" - after optimization you still see the same 0-zero results. Is there any solution not to output zeros during optimization?
Thanks!
I don't know if you do or not, I'll tell you just in case, check the "Ignore useless results" checkbox.
The minus results (by balance) will be eliminated, not sure about the zeros, but give it a try.
Like this:
:)
Like this:
:)
I don't know if you know this or not, but just in case, check the "Skip useless results" box.
The negative results (by balance) will be filtered out, I'm not sure about the null ones, but you should try it.
The thing is, I want to see null results - in the early stages of optimization I often have to select the best ones among null results (and in later stages it's useful to look through them and compare). Zeros get in the way because these very results don't make any sense and there are too many of them - the size of stored files get bigger and visually impede viewing results. Thanks anyway!
If you mean the external variables MA_Fast_Period and MA_Slow_Period, there is a solution. If the variables are calculated in the Expert Advisor, then there is nothing to be done.
It's late, my head isn't working anymore... but it sounds like a very good idea! Thank you!
I wonder how to get a "random" number within, say, 15 +/- 7 on each new tick, so that it is randomly generated within the given limits ...
To obtain random real numbers with uniform distribution in interval [a,b], use formula
x = rand()*(b-a)/RAND_MAX + a;
For mql, in the description of MathRand() function, it is written: The function returns a pseudorandom integer in the range from 0 to 32767
i.e. for mql RAND_MAX = 32767
I started to learn mq4, and immediately encountered some obscure moments.
I tried my hand at it, so to speak. I wrote a simple Expert Advisor on Ma. But it does not want to trade even on history. It produces no errors.
Can you tell me where I screwed up?
bool flagchange = false;
int Slippage = 3;
int i = 0;
double lt = getLots() ; // minimum lot
RefreshRates();
int total = OrdersTotal();
int ticket = -1;
for (;;)
{
int flag= GetEma();
if (flagchange != flag)
the for statement without the parameter? - the point? eternal loops are not written that way, and secondly, there are global variables for the EA - not for the terminal, they are described at the very beginning of the code before all functions and the start() function including, as you have written - at every tick you call the start() function, flagchange = false; and then you try to compare this flag with the previous state, but its state will always be false
If you are just starting to try your forces - take any ready-made Expert Advisor from Kodobase and change the conditions for entering the market to your own - it will be faster.
I started to learn mq4, and immediately encountered some obscure moments.
I tried my hand at it, so to speak. I wrote a simple Expert Advisor on Ma. But it does not want to trade even on history. It doesn't show any errors.
Can you tell me where I screwed up?
What is the purpose of the EA looping?
for (;;) { }