Questions from Beginners MQL5 MT5 MetaTrader 5 - page 819

 
fxsaber:

This works now in MT5.

Technically, nothing prevents you from doing the same thing ONE time with indicators (with no loss of efficiency) and putting the solution in SB.

You may be right.

But I have a different view. I think there is a lot of utility in these libraries. But these usefulnesses will never get mass distribution. There are two reasons for this.

1) an average person is not able to study the contents of libraries in details, "just in case something may come in handy". The average person has neither the time nor the energy to do this. If these libraries were furnished with a lot of actively used applications, some programmers would ask about it.

2. While the user will be learning the heel libraries, an updated and corrected six will come out:) Do you think not? You bet. And built not just on a new concept, but on a new paradigm (when all the previous code - libraries, applications, - all in the trash, as it was every time). And by logic, it should be. Who needs these backward-looking, "so-historical" arrays? Who needs this expert, "historically tied" to a window? Who needs an mql that has no continuity at all?

In short, if there is a pro who writes everything in C, he simply uses MT as a transit: quotes from there and trade orders to there. And his code will be inherited forever ... even if you release a tenner...
--
And for me, the multidimensional arrays and periodic consultations here on the forum are quite enough for my needs. I just need to understand what I should do, and how I should do it, it's a trifle.
Thank you for finishing this rubbish :)

 

Ladies and Gentlemen! Question: Why does the indicator (iCCI) go out of the window after the minimum and maximum values set in the properties, i.e. upper andlower limits? THANK YOU!

 

Can you please tell me where to get a full-fledged source code for the Moving Average indicator?
It would seem, that it's much easier. But no, in the standard sample Custom Moving Average.mq5 there is a truncated code (there is no "Apply to:" in the technical indicator).

 
User_mt5:

Where can I get a source code of Moving Average indicator?
I don't know, it could be much easier. But no, the standard sample Custom Moving Average.mq5 shows a truncated code (there is no what is called "Apply to:" in the technical indicator).

(Trolling is not welcome - deleted by Artyom Trishkin)

Search here.

Here is the beginning

//+------------------------------------------------------------------+
//|                                               MovingAverages.mqh |
//|                   Copyright 2009-2017, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2009-2017, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
//+------------------------------------------------------------------+
//| Simple Moving Average                                            |
//+------------------------------------------------------------------+
double SimpleMA(const int position,const int period,const double &price[])
  {
//---
   double result=0.0;
//--- check position
   if(position>=period-1 && period>0)
     {
      //--- calculate value
      for(int i=0;i<period;i++) result+=price[position-i];
      result/=period;
     }
//---
   return(result);
  }
 
Alexey Viktorov:

Search here.

Here's the beginning.

It is. I have that too. I also need the one with (H+L+C)/3.

I've been looking for it. I'll have to do it myself.

Thank you.

 
User_mt5:

That's true. I have that too. I also need one with (H+L+C)/3.

I've been looking for it. I'll have to do it myself.

Thank you.

Here's what that statement looks like:

There's a bike, but the back wheel's been removed... I'll have to make the bike myself...

Who or what prevents you from making an array with prices (H+L+C)/3 and putting that array in there...

 

Hi all. I decided to try to study MQL. I found 3 muwings and stochastic in MetaEditor 5. I have not got any order exit, i.e. i don't have take profit. I have never tried to use anchor profits in my EA, I've never tried to buy them before, I just don't know where and how to place them. I don't know how to buy and sell. Here is the code itself:

; saved automatically on 2018.01.14 00:39:27
; this file contains last used input parameters for testing/optimizing Stochastic and 3 iMA expert advisor
;
lot=0.1||0.1||0.010000||1.000000||N
stop_=700||700||70.000000||7000.000000||N
magick=54
per_4=4||4||1||40||Y
metodMA4=1||0||0||3||Y
priceMA4=1||1||0||7||Y
per_13=10||10||1||130||Y
metodMA13=1||0||0||3||Y
priceMA13=1||1||0||7||Y
per_50=50||50||1||200||Y
metodMA50=1||0||0||3||Y
priceMA50=1||1||0||7||Y
per_K_Stoh=5||5||1||20||Y
per_D_Stoh=3||3||1||20||Y
slowing=3||3||1||20||Y
highLevel=70||70||1||90||Y
lowLevel=10||10||1||30||Y
revers=false||false||0||true||N

 

We all know the Custom Moving Average.mq5
I try to make a custom indicator based on it.
It should calculate all the same, but not for the entire history, but for the number of bars, specified in custom indicator settings.
At this stage everything is clear.

But there is a problem with the ENUM_APPLIED_PRICE parameter. Shouldn't it be passed to iCustom() to calculate MA? Yes, it should. But how?

If you simply display the Custom Moving Average on the chart, an additional tab will appear in the settings panel,
where you can select a specific parameter from ENUM_APPLIED_PRICE.

But where is this parameter in iCustom()? After all, only parameters specified as input can be passed into iCustom().
But there is no ENUM_APPLIED_PRICE in inputs.

Well. And what to do?

How custom is Moving Average? Maybe it has hidden gears?)

 
User_mt5:

We all know Custom Moving Average.mq5
I am trying to make a custom indicator based on it.
It should calculate the same, but not for the entire history, but for the number of bars, as specified in custom indicator settings.
At this stage everything is clear.

But there is a problem with the ENUM_APPLIED_PRICE parameter. Shouldn't it be passed to iCustom() to calculate MA? Yes, it should. But how?

If you simply display the Custom Moving Average on the chart, an additional tab will appear in the settings panel,
where you can select a specific parameter from ENUM_APPLIED_PRICE.

But where is this parameter in iCustom()? After all, only parameters specified as input can be passed into iCustom().
But there is no ENUM_APPLIED_PRICE in inputs.

Well. And what to do?

How custom is Moving Average? Maybe it has hidden gears?)


The iCustom reference:

   MA_handle=iCustom(NULL,0,"Examples\\Custom Moving Average", 
                     MA_Period, 
                     MA_Shift, 
                     MA_Method, 
                     PRICE_CLOSE // считаем по ценам закрытия 
                     ); 

That is, the type of price on which the calculation is based, is specified at the very end.

 
Vladimir Karputov:

The iCustom reference:

That is, the type of price on which the calculations are based is stated at the very end.

Thank you, that's very informative. Thank you.

It's almost a revelation to me. Reading the iCustom help and input you wouldn't know that... What a mysterious mql ...

Reason: