[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 562

 
double tenkan,kiju,chinku;
   tenkan=iIchimoku(Symbol(),PERIOD_H4,12,24,120,1,0);
   kiju=iIchimoku(Symbol(),PERIOD_H4,12,24,120,2,0);
   chinku=iIchimoku(Symbol(),PERIOD_H4,12,24,120,5,0);
   
   Print("tenkan:",tenkan," kiju:",kiju," chinku:",chinku);

chinko span output 0, what is the problem?

2012.02.14 08:33:25 NEW GOLD,M5: tenkan:1718.2 kiju:1727.8 chinku:0

 
sss2019:

Tell me why there might be an error 130


Stops too close or incorrectly calculated or non-normalised prices in the stops(or in the Level price of the pending order opening).

ticket1 = OrderSend(Symbol(),OP_BUYLIMIT,Lot,Level,Slippage,0,0,NULL,MagicNumber,0,Green);
 
Sepulca:


Stops too close or incorrectly calculated or non-normalized prices in the stops(or in the Level price of opening a pending order).


Don't bother - you don't know what it may be - it may be many things - everything that matches the description of this error... why guess? :-)

ERR_INVALID_STOPS 130 Incorrect stops

Make it a rule of thumb to ALWAYS make the necessary checks when placing or opening an order from the market, and modifying it.

Everything.

О! Sorry - it turns out you were the one who answered... :-) And I am answering you... :-)

 
Reshetov:


Comment on the transaction, I always put 0 when I don't want to put a comment))
 
sss2019:

...

Don't sweat it - who knows what it could be - lots of it - everything that matches the description of the error...why guess? :-)

ERR_INVALID_STOPS 130 Incorrect stops

If you have a good faith in a market order, you should always make the required checks when you set or open it, as well as when you modify it.

Everything.
 

trade 0.1 lot on pound-dollar - max drawdown 3%=))) flipped the EA and look what I got=)))

 
alsu:

It cannot be stored anywhere in the terminal, because leverage can be floating and only the server can know about it. In my opinion, the most correct way of calculation is as follows:



I've read and thought about it, and did it my way, but the question arises - is the separator in numbers of double type always equal to dot?

void start()
  {
   double x = MathMin(MarketInfo(Symbol(), MODE_MINLOT),MarketInfo(Symbol(), MODE_LOTSTEP));

   Comment(digits(x));
  }
//+------------------------------------------------------------------+
int digits(double number)
  { 
  string y = DoubleToStr(number,8);
  int k = StringLen(y)-2;
  
  for(int i = -1; ;k--)
    {
    string x = StringSubstr(y,k,1);
    if(x != "0" && i < 0) i = k;
    if(x == ".") return(i-k); //Разделитель в mql4 всегда равен - точке?
    }
  }
 
fore-x:

I've read and thought about it, and did it my way, but a question has arisen - is the separator in numbers of the double type always equal to a dot?


Yes. It's a programming language, it's not Excel or handwritten text.
 
fore-x:

I've read and thought about it, and did it my way, but a question has arisen - is the separator in numbers of the double type always equal to a dot?


Always.
 

How to terminate an Expert Advisor programmatically - something like terminate(0) ?

Does MQL4 have such a possibility, or is it only possible to terminate an Expert Advisor manually?

Thanks in advance.

Reason: