Errors, bugs, questions - page 255

 
Try using "Profiles" - they give similar functionality to tables/sheets
 
Renat:
Try using "Profiles" - they give similar functionality to tables/sheets

Thanks. Only thing is, it's a shame you can't put a profile management button on the panel, it would be really cool.
 

After compiling:

tree optimization error 1 1

Deleting even a larger code block than the one where the changes were made didn't fix the situation.

Can optimization be disabled? And to what height may this optimization tree "grow"?

How to avoid it?

 

Three questions have arisen:

1) What is the optimization that the person above writes about, and does it affect the speed of computation and the speed of the program (object creation and initialization)? In Basics 6m, for example, it was possible to enable "fast code" compilation option. Is it possible in MKL5?

2) Respected Renat said that calculations are fast now and dll is not needed. Did someone compare speed with C++ dll - what is the difference? The question is not idle, because the first block of my TS is calculated for several hours, and I wanted to have time to compute in real time between appearances of 2 candlesticks. Is it worth to transfer the calculations to a dll?

3) How can you speed up the program?

I would be grateful to all who replied. Merry Christmas and a Happy New Year!

 
// входные параметры индикатора
input bool            inp_FLine        = true;
input int             inp_FLine_width  = 1;
input ENUM_LINE_STYLE inp_FLine_style  = STYLE_SOLID;
input color           inp_FLine_col    = DeepPink;  

// клоны входных параметров
bool              FLine;
int               FLine_width; 
ENUM_LINE_STYLE   FLine_style;
color             FLine_col;

int OnInit()
{
// инициализация клонов входными параметрами
PLine           = inp_PLine;
FLine_width     = inp_FLine_width;
PLine_style     = inp_PLine_style;
PLine_col       = inp_PLine_col; 
}

int OnCalculate()
{

if(PLine)
{
FLine_width     = Func(FLine_width);
PLine_style     = Func(PLine_style);
PLine_col       = Func(PLine_col); 
}

// применение новых значений
SetParam(FLine_width,PLine_style,PLine_col);
}


// Такой код с большим кол-вом параметров может привести к
// 
// tree optimization error  ?


Such code with so many parameters may cause

tree optimization error ?

I used this way to manage the properties of graphical objects because of the impossibility to change the values of input parameters of the indicator.


P.S.

I commented out almost all code in parts. Only when I had a couple of lines left the compilation was successful.

Then I removed ALL the comments and everything continued to work.

So what was that?

 
zloymudvin:
Thank you. The only thing is, it's a shame you can't put a profile management button on the panel, that would be great.

Look at the command to switch profiles on the status bar:


 

I have seen such errors very often on mt5 a year and a half ago, didn't say anything as it is impossible not to notice them. It seems to have been fixed.

By the way, I have seen such errors in mt4 very often.

Now I see the same error again. Again the history is being downloaded with errors. I think it is impossible to add the delete symbol history button in case of this error, as it is the main reason of all inconveniences.

A very frequent error deserves a separate button.


 
vicondi:

After compiling:

tree optimization error 1 1

Deleting even a larger code block than the one where there were changes didn't fix the situation.

Can optimization be disabled? And to what height may this optimization tree "grow"?

How to avoid it?


Create a request to the service desk and provide the source code, the terminal build and bit rate.

Most likely, the error is on our side, but we need source code to reproduce and fix it.

 

Good afternoon! A little help here for a newbie.

// deletion of the shelves


void deleteAllOrder()
{
for(int i = 0; i < OrdersTotal();i++)
{
order_ticket = OrderGetTicket(i);
HistorySelect(0,TimeCurrent());

MqlTradeResult result;
MqlTradeRequest request;

request.order = order_ticket;
request.action = TRADE_ACTION_REMOVE;
OrderSend(request,result);

How to correct the code which removes not all of the pending orders but only pending orders for a selected symbol. I can't get it right now(

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций - Документация по MQL5
 
dimmi2000:

Good afternoon! A little help here for a newbie.

// delete pending orders


void deleteAllOrder()
{
  for(int i = 0; i < OrdersTotal();i++)
   {
      order_ticket = OrderGetTicket(i);
      HistorySelect(0,TimeCurrent());             //зачем?
      
      MqlTradeResult result;
      MqlTradeRequest request;
      
      request.order = order_ticket;
      request.action = TRADE_ACTION_REMOVE;
      OrderSend(request,result);

How can I tweak the code to delete all the pending orders but only the orders for a selected symbol. I can't find it right now.

Look at the description of the OrderGetString() function and its parameter ENUM_ORDER_PROPERTY_STRING
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5