Questions from Beginners MQL5 MT5 MetaTrader 5 - page 688

 
Artyom Trishkin:

Really? Really?

I always thought that(^) was a power increase.

Try compiling this example:

//+------------------------------------------------------------------+
//|                                                       Test_1.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart(void)
  {
   double a=2;
   double b=3;
   double c=a^b;
   int g=0;
//---
  }
//+------------------------------------------------------------------+

and the urge to be sarcastic will disappear on its own.

 
Artyom Trishkin:
Exponentiation.

I have a broken clock -- it is guaranteed to tell a very accurate time twice a day.

Degree conversion https://www.mql5.com/ru/docs/math/mathpow

So, here, Karputov is right -- ^ is an "exclusive OR".

see the list of operations https://www.mql5.com/ru/docs/basis/operations/rules

 
Vladimir Karputov:

Try to compile this example:

//+------------------------------------------------------------------+
//|                                                       Test_1.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart(void)
  {
   double a=2;
   double b=3;
   double c=a^b;
   int g=0;
//---
  }
//+------------------------------------------------------------------+

and the urge to quibble will go away on its own.

and does it compile? It doesn't...

'^' - illegal operation use

And here's what Wiki says:

The magnification sign: ^ (not used in typewritten or handwritten formulas; used in programming, along with the rarer symbols ↑ and **, and in "linear" text formulas).

 

Gentlemen, stop arguing. I, too, think that this sign in at least the 4-R was an erection to a degree.

You better tell me why this

Bars(_Symbol,_Period);//равно 0 при отключенном подключении к Интернет

doesn't work when the internet connection is disconnected?

 
Vladimir Karputov:

Try to compile this example:

//+------------------------------------------------------------------+
//|                                                       Test_1.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnStart(void)
  {
   double a=2;
   double b=3;
   double c=a^b;
   int g=0;
//---
  }
//+------------------------------------------------------------------+

and the urge to be sarcastic will disappear on its own.

I didn't fall for the joke provocation, as I immediately saw the error )

And you, Karputov, are a sly one, it turns out.

You have learned how to teach newbies implicitly, like, "try to compile" and you will understand the question more deeply.

 
Andrey F. Zelinsky:

I have a broken clock -- it is guaranteed to tell a very accurate time twice a day.

Degree conversion https://www.mql5.com/ru/docs/math/mathpow

So, here, Karputov is right -- ^ is an "exclusive OR".

see list of operations https://www.mql5.com/ru/docs/basis/operations/rules

What if the person didn't give a formula from mql ?

If he just got it from somewhere else?

That's usually how they refer to exponentiation.

Of course, his example (if written correctly) shows that this sign in mql code is NOT exponentiation (pow()), but here we need to clarify what the questioner meant. And judging by his formula GHPR=(BalanceClose/BalanceOpen)^(1/N), he did NOT mean mql syntax, because it clearly shows double, not char values, which are needed for bitwise operations.

 
Andrey F. Zelinsky:
I didn't give in to the provocation as I immediately saw the error.

char a='a', b='b';
//--- exclusive OR operation
char c=a^b;
Print("a = ",a," b = ",b);
Print("a ^ b = ",c);
//The result will be:
// a = 97 b = 98
// a ^ b = 3

Bitwise operations are only performed onintegers.

 
Andrey F. Zelinsky:

I did not fall for the joke provocation, as I immediately saw the error )

And you, Karputov, are a sly one, it turns out.

Learned to teach the newbies implicitly, they say, "try to compile" and you will understand the question more deeply.

Are you calling me a beginner? Thank you - well preserved it turns out...

So I wonder if Mr. Karputov himself was able to compile his code...

 
Artyom Trishkin:

You're the one who called me a rookie. Thank you - I'm in good shape, it turns out...

So I'm wondering if Mr. Karputov himself could compile his code...

Artyom, there's a popular saying: "You live a long time, you learn a long time".

And Socrates said, "I know I know nothing."

I don't know what "Karputov could do." -- I don't know.

 
the formula is taken from here - https://www.mql5.com/ru/articles/1492
Математика в трейдинге. Оценка результатов торговых сделок
Математика в трейдинге. Оценка результатов торговых сделок
  • 2007.08.15
  • MetaQuotes Software Corp.
  • www.mql5.com
Все мы слышали фразу "Никакая полученная прибыль в прошлом не гарантирует успешных результатов в будущем". Но необходимость оценки торговых систем тем не менее является актуальной. В этой статье мы рассмотрим некоторые простые и удобные методики оценки торговых результатов.
Reason: