Errors, bugs, questions - page 1002

 
sion:

if should it work with arrays or is it a bug?

Bug, because the following does not compile, so your example should not
( (bool)ts )
( (int)ts )
( ts == true )
( ts != NULL )
 
Vladon:

As far as I know - updating the terminal is done for a reason, some functions become broken, that's for sure.

But how to disable the update - it should work cleverly, because it seems very simple to me.

Indeed, everything is simple :)

And where did you read what has changed in the new build?

Thank you!

 
ns_k:

Really simple :)

Where can I read what has changed in the new build?

Thank you!

https://www.mql5.com/ru/forum/23
Список изменений в билдах MetaTrader 5 Client Terminal
Список изменений в билдах MetaTrader 5 Client Terminal
  • www.mql5.com
Автоматическое обновление доступно через систему LiveUpdate:.
 

Good afternoon!

I use levels in the indicator window

IndicatorSetDouble(INDICATOR_LEVELVALUE,1,80);  

It is good that there can be several levels. Is there a possibility to set one and the same property for different levels differently?

I.e., for example, I would like 1.80 to be drawn as blue solid and 0.20 to be drawn as black dashed.

Thank you!

 
  void fLog(string Message){
    //ЗАПИСЬ В ТХT
   ResetLastError();
    filehandle=FileOpen(file_name,FILE_WRITE|FILE_TXT);
   if(filehandle!=INVALID_HANDLE){
        FileSeek(filehandle,0,SEEK_END);
        FileWrite(filehandle,Message);
        FileClose(filehandle);
        //Print("Запись удачна!"); 
     }
   else Print("Операция FileOpen неудачна, ошибка ",GetLastError()); 
        } 
I want to add to the end of the file and it gets overwritten. What's wrong?
 

If FILE_WRITE - file is re-created with zero size

If FILE_READ|FILE_WRITE - a new file is created if there is no file with that name.

 

Writing code

//+------------------------------------------------------------------+
//|                                                   LEVELSTEST.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 1
#property indicator_plots   1

int OnInit()
  {
//--- indicator buffers mapping
  
  
   IndicatorSetInteger(INDICATOR_LEVELS,2);
   IndicatorSetInteger(INDICATOR_LEVELCOLOR,clrBlue);
   IndicatorSetInteger(INDICATOR_LEVELSTYLE,2);
   IndicatorSetDouble(INDICATOR_LEVELVALUE,0,30.0);
   IndicatorSetDouble(INDICATOR_LEVELVALUE,1,50.0);
      
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   
  }
//+------------------------------------------------------------------+

The output I get is

https://www.mql5.com/en/charts/408767/eurusd-m5-alpari-fs-levels-test

Should this be the case, or should level 50 be drawn as a blue dotted line as well?

Thank you!

Chart EURUSD, M5, 2013.06.16 22:20 UTC, Alpari FS, MetaTrader 5, Demo
Chart EURUSD, M5, 2013.06.16 22:20 UTC, Alpari FS, MetaTrader 5, Demo
  • www.mql5.com
Chart EURUSD, M5, Alpari FS: LEVELS TEST
 
A100:

If FILE_WRITE - file is re-created with zero size

If FILE_READ|FILE_WRITE - a new file is created if there is no file with that name.

Thank you.
 
ns_k:

It is good that there can be several levels. Is it possible to set the same property for different levels differently?

I.e., for example, I would like 1.80 to be drawn as a blue solid and 0.20 to be drawn as a black dotted line.

Of course, they only published examples the other day:

  1. Demo_IndicatorSetInteger
  2. Demo_IndicatorSetDouble
  3. Demo_IndicatorSetString
 
A100:
Bug, because the following does not compile, so your example should not.

ts==true and ts!=NULL are completely different expressions.

Moreover

ts==true and ts!=false are also different expressions.

Do you know how they are different? Not only in syntax, but also in semantics.