[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 987

 
I see, thank you.
 
Hi all. Here's a question. How do I write the following condition in MQL4: If stochastic > level 20, then...
 

write it that way :) If stochastic > 20 then .... :)

---

if ( iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0) > 20) { ... then ... }

 
donec:
Hello, everybody. Hi, I have a question. How to write the condition in MQL4: If stochastic > level 20, then...

The question is vague. You didn't specify - which stochastic line is higher - the main or signal one, on which bar, what stochastic parameters... So it's just a general one:

double Level=20.0;
double dg=MarketInfo(Symbol(), MODE_DIGITS);
double StochSig1 =iStochastic(Symbol(), Period(), k_period, d_period, slowing, MODE_SMA, 0, MODE_MAIN, 1);   // Главная на 1-м баре
double StochSig2 =iStochastic(Symbol(), Period(), k_period, d_period, slowing, MODE_SMA, 0, MODE_MAIN, 2);   // Главная на 2-м баре
double StochMain1=iStochastic(Symbol(), Period(), k_period, d_period, slowing, MODE_SMA, 0, MODE_SIGNAL, 1); // Сигнальная на 1-м баре
double StochMain2=iStochastic(Symbol(), Period(), k_period, d_period, slowing, MODE_SMA, 0, MODE_SIGNAL, 2); // Сигнальная на 2-м баре

if (NormalizeDouble(StochSig1-Level, dg)>0.0)     // Если сигнальная Стохастика на 1-м баре выше 20.0
   {
         //.......... блок кода, если это верно ...........
   }
 
Thanks for the answers...
 
Aleksander:
Probably Not - rare testers allow the minimum lot to do less than 0.1 - to simulate this variant - increase the test deposit by 10 times...
Hello, I'm your aunt... Who told you such nonsense I wonder?
 
artmedia70:
Hi, I'm your aunt... Who told you that nonsense?

In my brokerage company, in the tester, the minimum lot is 0.1:

ERR_INVALID_TRADE_VOLUME 131 Incorrect volume
 
Aleksander:

In my brokerage company, the minimum lot in the tester is 0.1:

ERR_INVALID_TRADE_VOLUME 131 Incorrect volume

That's not surprising. If the DC told you that the minimum = 0.1, then why the hell argue with him by setting a smaller lot?
 
drknn:

Well, that's not surprising. If the dealer told you that the minimum = 0.1, then why the hell argue with him, setting a smaller lot?
so it's the comrade above that has a misunderstanding of the process :)
 
Aleksander:

In my brokerage company, in the tester, the minimum lot is 0.1:

ERR_INVALID_TRADE_VOLUME 131 Incorrect volume
So it's not the tester, as you wrote, it's the DC