Errors, bugs, questions - page 356

 
Im_hungry:

I've written something similar to this, but you should label the arrays differently - (unlikely to help, but at least

this is better). change it:

on these lines.

Also change:

to that.

Not like this. Several builds ago, the old Type() methods in CPositionInfo, COrderInfo and CDealInfo classes of the standard library have been replaced by the PositionType(), OrderType() and DealType(). So, these functions should be corrected in previously written MQL5 programs, otherwise they won't work properly.

I would rewrite your code like this:

#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>
#include <Trade\SymbolInfo.mqh>

input int TriX_PARAM=14;
input int TriX_PARAM_Close=50;

double TriX[];
double TriX_Close[];
int TriXHandle;
int TriXHandle_Close;
CTrade mytrade;
CPositionInfo myposition;
CSymbolInfo mysymbol;
COrderInfo myorder;
int OnInit()
  {

   TriXHandle=iTriX(NULL,PERIOD_CURRENT,TriX_PARAM,PRICE_WEIGHTED);
   TriXHandle_Close=iTriX(Symbol(),PERIOD_CURRENT,TriX_PARAM_Close,PRICE_WEIGHTED);
   ArraySetAsSeries(TriX_Close,true);
   ArraySetAsSeries(TriX,true);
   return(0);
  }

void OnTick()
  {
   if(myposition.Select(_Symbol))
    { 
     CopyBuffer(TriXHandle_Close,0,0,4,TriX_Close);
     if(myposition.PositionType()==POSITION_TYPE_BUY) 
//Закрываем позицию
     {
      if(TriX_Close[1]<TriX_Close[2] && TriX_Close[2]>TriX_Close[3]) 
        mytrade.PositionClose(_Symbol);
     } 
     else  
      if(TriX_Close[1]>TriX_Close[2] && TriX_Close[2]<TriX_Close[3]) 
        mytrade.PositionClose(_Symbol);
    }
   else
//Открываем позицию
     {
      CopyBuffer(TriXHandle,0,0,4,TriX);
      if(TriX[1]>TriX[2] && TriX[2]<TriX[3]) mytrade.Buy(0.1);
      if(TriX[1]<TriX[2] && TriX[2]>TriX[3]) mytrade.Sell(0.1);
     }
  }
Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
Rosh:
All chart windows are numbered from zero. 0 - main chart window, 1 - first indicator window, which is shown in a separate window. And so on.

There are no questions about that! But where are the values of minimum and maximum, and why do they appear only after the manipulations with the chart?
 
KffAlex:
There is no question about that! But where are the minimum and maximum values, and why do they only appear after manipulating the graph?
Better write to the service-desk. This is most likely a bug.
 

Please enlighten me as to what the error means

internal error #108             0       0

when compiling the script?

 
alsu:

Please enlighten me as to what the error means

when compiling the script?

As far as I understand it is

108 Unsuitable name for #define

 
Interesting:

As far as I understand it.

108 Unsuitable name for #define

The point is that there are no defines or inludes in the script.

 
 
alsu:

the thing is, there are no defines or inludes in the script.

The script contains both
#include
и
#define
 
alsu:

Then block-by-block transfer from the script to another normally compiled one. and you will come across a faulty line.

Write back what it was.

 
sergeev:

then block-by-block transfer from the script to another normally-compiled script. and you'll come across a faulty line.

Please let me know what it is.

Made it simple.

I commented out /* */ all OnStart() function body - the error remained. Also, after restarting the machine.

I repeat, no inludes or defines, nothing at global level, including external variables. I don't want to reinstall terminal yet))

Developers, HA!!! What does internal error #108???? mean?