Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 690

 
_new-rena:
A few indicators and the necessary mathematical work on them might solve this problem
In the standard MA there is a switch from cloze to max, min, etc., but I can't find the file with the code in the folder.
 
Forexman77:
The standard MA has a switch from cloz to max, min, etc., but I can't find the code file in the folder.
iMA
 
_new-rena:

But, there are no parameters where you can influence the parameter that is in the figure.

The smoothing method is passed without problems

extern ENUM_MA_METHOD MA_Method=MODE_SMMA;

And here if

extern ENUM_APPLIED_PRICE price= PRICE_CLOSE;
for(i=limit1;i>=0;i--) ExtMapBuffer1[i]=price[i];

requires an array "[' - array required"

 
Forexman77:

But, there are no parameters where you can influence the parameter that is in the figure.

The smoothing method is passed without problems

And here if

requires an array "'[' - array required''.


It doesn't require anything, everything is optimised - both method and price. Why do you need a loop with an array? Pass the enumeration from the EA to the indicator and everything will be fine.


 
evillive:

It doesn't require anything, everything is optimized - both method and price. Why do you need a loop with an array? Pass the enumeration from the Expert Advisor to the indicator and everything will be fine.

Holy crap, I'm a little confused. I don't need the MA. I need to get the price in the indicator calculation cycle to calculate the indicator. Here is the Close[i] - Close[i+5],

How to pass it to the indicator instead of Close[i] be for example Low[i] , weighted average prices and medians are not so important - they can be calculated.

I.e. optimize by maxima, minima and closing.

 
Forexman77:

Holy crap, I'm a little confused. I don't need the MA. I need to get the price in the indicator calculation cycle to calculate the indicator. Here is the Close[i] - Close[i+5],

How to pass it to the indicator instead of Close[i] be for example Low[i] , weighted average prices and medians are not so important - they can be calculated.

In other words, we can optimize them by maxima, minima and closing.


Then we have to create an array and master CopyClose, CopyOpen, CopyHigh, CopyLow - to copy the appropriate price in the array.

or learn how to work with classes and other novelties of the new language, Indicator.mqh as an example will do

 
evillive:

Then we have to create an array and master CopyClose, CopyOpen, CopyHigh, CopyLow - to copy the appropriate price to the array.

Or master classes and other novelties of the new language, the Indicator.mqh inluder will do as an example

I see, I will think about it, there are some examples in MQL5, meanwhile I have to change them manually.
 
Forexman77:
I see, I'll think about it, there are examples in MQL5. In the meantime, I'll change it manually.

If anyone needs it, I've figured out how to draw an indicator by price type without any complicated constructions:

extern int price=1;//1=Close, 2=High, 3=Low, 4=PRICE_MEDIAN_, 5=PRICE_TYPICAL_, 6=PRICE_WEIGHTED_

for(i=limit1;i>=0;i--) 
   {
   if (price == 1)ExtMapBuffer1[i]=Close[i];//Close
   if (price == 2)ExtMapBuffer1[i]=High[i];//High
   if (price == 3)ExtMapBuffer1[i]=Low[i];//Low
   if (price == 4)ExtMapBuffer1[i]=((High[i]+Low[i])/2);//PRICE_MEDIAN_
   if (price == 5)ExtMapBuffer1[i]=((High[i]+Low[i]+Close[i])/3);//PRICE_TYPICAL_
   if (price ==6){ExtMapBuffer1[i]=((High[i]+Low[i]+Close[i]+Close[i])/4);//PRICE_WEIGHTED_
   }
 
Forexman77:

If anyone needs it, I've worked out how to do a price-type indicator rendering without complicated constructions:


Little mistake: 0=Close, 1=Open, the rest is correct.
 
Can you please tell me if an EA written for MT5 can be run on the latest MT4 and vice versa?
Reason: