Errors, bugs, questions - page 832

 

terminal time - must be real, corresponding to the bloody meridian of Paris.

 

Thank the gods it's a demo - otherwise everyone would have noticed and claimed it a long time ago

 
Arkadiy:

terminal time - must be real, corresponding to the bloody meridian of Paris.

Why "Parisian"?
 

Fellow developers !

I don't know who's right and who's wrong, but mql doesn't match C++ in a place like this:

class Q
{
public:
        Q(){}
        Q Fn() 
        {
                return(this);
        }

protected:
        Q(Q&) { Alert("copy constructor"); }
        void operator=(Q&) { Alert("operator="); }
};


void OnStart()
  {
//---
      Q w;
      w.Fn();
  }

Alert: operator=

In C++ we get "copy constructor" in a similar situation

The question was raised quite a long time ago, maybe you've forgotten it.

 
220Volt:

Fellow developers !

I don't know who's right and who's wrong, but mql doesn't match C++ in a place like this:

Alert: operator=

In C++ we get "copy constructor" in a similar situation

The question has been raised quite a long time ago, maybe you've forgotten it.


Yes, mql there is a C++ inconsistency when returning an object from a function. A fix is planned, the behaviour will be like in C++.
 

Hello.

When installing the script on the chart, the window for assigning values to external variables does not appear, i.e. the extern command is not executed???

The log displays the variables that are prescribed in the script code or zeros, for example:

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: removed

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: uninit reason 0

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: Mn=0; StopLoss=350;

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: loaded successfully

I.e. MetaEditor is running with an error.

Could you please tell me what the problem may be and what I should do?

Best regards!

Vladislav.

Документация по MQL5: Основы языка / Операции и выражения / Операции присваивания
Документация по MQL5: Основы языка / Операции и выражения / Операции присваивания
  • www.mql5.com
Основы языка / Операции и выражения / Операции присваивания - Документация по MQL5
 
vlad-755:

Hello.

When installing the script on the chart, the window for assigning values to external variables does not appear, i.e. the extern command is not executed???

The log displays the variables that are prescribed in the script code or zeros, for example:

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: removed

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: uninit reason 0

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: Mn=0; StopLoss=350;

2012.08.29 17:12:05 OpenBuy1 EURUSD,H1: loaded successfully

I.e. MetaEditor is running with an error.

Could you please tell me what the problem is and what I should do?

Best regards!

Vladislav.

Add at the beginning of the script

#property script_show_inputs

 

When adding the suggested string, the script fails to pass through the compiler (gives 1 warning and 1 error):

Êîìïëåâèäëåíèÿ 'OpenBuy1.mq4'...
'script_show_inputs' - unknown property C:\Program Files\WFTS-DEMO\experts\scripts\OpenBuy1.mq4 (6, 1)
'script_show_inputs' - defined value expected C:\Program Files\WFTS-DEMO\experts\scripts\OpenBuy1.mq4 (6, 1)
1 error, 1 warning

The string is pasted via the clipboard.

Script code:

//+------------------------------------------------------------------+
//|OpenBuy1.mq4 |
//|Copyright 27.08.2012.|
//|Script opens BUY order with preset Mn and volume (lot).|
//+------------------------------------------------------------------+
#property script_show_inputs
#property copyright "Copyright 27.08.2012"
#property link ""
//+------------------------------------------------------------------+
//|Notes:|
//+------------------------------------------------------------------+
/*
- does not display the external variable setting window ?????
*/
//+------------------------------------------------------------------+
//|External variables (accessible from the program properties window) |
//+------------------------------------------------------------------+
extern int Mn; //Magic number.
extern double Lots =0.1;//Lot size.
extern double StopLoss =350;// SL for the order being opened.
extern double TakeProfit =35; // TP for the order being opened

Maybe something else is wrong? Could you please advise.

Respectfully.

Vladislav.

ilunga:

Add at the beginning of the script

#property script_show_inputs

Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 

"If all else fails, read the documentation" (cz)

I should add: read the four's documentation.

And your question is for the four forum

Специальные параметры - Документация на MQL4
  • docs.mql4.com
Специальные параметры - Документация на MQL4
 
stringo:

"If all else fails, read the documentation" (cz)

I should add: read the four's documentation.

And your question is for the four forum.

It worked, thank you.

Vladislav.

Reason: