Colour of the standard indicator - page 4

 

1. this is NOT the Moving Average!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Put the Moving Average and Castom Moving Average on the chart !

MA

Here are the parameters for Moving Average - their 7!!!!!!!!!!!!!!!!!!!!!!!!!!

2. Yes? So why can't you change it from your code?

 
Mikalas:

1. this is NOT the Moving Average!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Put the Moving Average and Castom Moving Average on the chart !

2. Yes? So why can't you change from your code?

1. Your assertion needs strict proof

2. Because colour has no effect on calculation. Because when you create an indicator from an Expert Advisor, only its calculation part is created without interface part, which makes no sense for the Expert Advisor.

 
Mikalas:
...

2. Yes? So why can't you change from your code?

Let me ask you again:

Do you want to know the reason why you can't,

or

Do you want to tell the developers that it should be possible?

 
Mikalas:


Here are the input parameters for the Moving Average - there are 7!!!!!!!!!!!!!!!!!!!!!!!!!!

Why 7? Follow the link and read

int  iMA(
   string               symbol,            // имя символа
   ENUM_TIMEFRAMES      period,            // период
   int                  ma_period,         // период усреднения
   int                  ma_shift,          // смещение индикатора по горизонтали
   ENUM_MA_METHOD       ma_method,         // тип сглаживания
   ENUM_APPLIED_PRICE   applied_price      // тип цены или handle
   );

except for the symbol-period, there are only 4 input parameters

 

Urain!

I want to know why you can't and get the message to the developers that this should be the case!

stringo!

What I posted the picture for?

Go to the IndicatorCreate() reference, not the iMA reference

and read it carefully:

int  IndicatorCreate(
   string           symbol,                            // имя символа
   ENUM_TIMEFRAMES  period,                            // период
   ENUM_INDICATOR   indicator_id,                      // тип индикатора из перечисления ENUM_INDICATOR
   int              parameters_cnt=0,                  // количество параметров
   const MqlParam&  parameters_array[]=NULL,           // массив параметров
   );

where MqlParam

parameters_array[]=NULL

[in] Array of type MqlParam the elements of which contain type and value of each input parameter of the technical indicator.

By the way, there are only 3 input parameters in Custom Moving Average!

Moving Average is NOT a Custom Moving Avarage!

The iMA() function is designed for simple adding to the chart of the indicator, and the IndicatorCreate() function is designed for advanced creation.

E.g. FileCreate() and FileCreateEx();

Mikhail

 

Mikalas:

[in] Array of MqlParam type, the elements of which contain type and value of each technical indicator input parameter.

Colour is not an input parameter of a technical indicator.
 
Mikalas:

Urain!

I want to know why you can't and get the message to the developers that this should be the case!

stringo!

What did I post the picture for?

Go to the IndicatorCreate() reference, not the iMA reference

and read it carefully:

where MqlParam

parameters_array[]=NULL

[in] Array of type MqlParam the elements of which contain type and value of each input parameter of the technical indicator.

By the way, there are only 3 input parameters in Custom Moving Average!

Moving Average is NOT a Custom Moving Avarage!

Michael

All parameters that are required (and even those that are not needed or used in calculations) for the calculations in the indicator and for the analysis in the Expert Advisor can be registered in the input variables of the custom (self-written) indicator. These parameters will be available when attaching the indicator to a chart and when called programmatically from the Expert Advisor.

Andrey

 

Dear colleagues!

For Moving Average it's input!

There is no code for Moving Average (WHEN YOU UNDERSTAND THAT?) There is one for Custom Moving Average.

I wrote to tech support. Let's see what they will say.

Mikhail

 
Mikalas:

Urain!

I want to know why you can't and to let the developers know that this should be the case!

First of all, your comparison of the interface of standard indicators and custom ones is not quite correct.

Standard indicators are indicators that have been heavily optimized, and as you can see their interface is slightly different.

Now why not

the indicator colour is set in the preprocessor directive, it is loaded first, followed by input parameters.

Preprocessor directives are immutable from the outside, at least because MQL5 has no #if #endif exceptions.

you cannot create a customizable preprocessor directive.

The way out of this situation is to use the method described above, put the colour into instances and set it explicitly through PlotSet...

 

Urain!

No code for Moving Average!

What does the preprocessor have to do with it?

I don't create an indicator and then change its colour!

The indicator is created with a colour parameter.

params[0].type = TYPE_INT;
        params[0].integer_value = 10;
        
        params[1].type = TYPE_INT;
        params[1].integer_value = 0;
        
        params[2].type = TYPE_INT;
        params[2].integer_value = MODE_SMA;
        
        params[3].type = TYPE_INT;
        params[3].integer_value = PRICE_MEDIAN;
        
        params[4].type = TYPE_COLOR;
        params[4].double_value = clrBlue;
        
        ma_handle = IndicatorCreate( NULL, PERIOD_CURRENT, IND_MA, 5, params );
        if ( ma_handle != INVALID_HANDLE )
      {
        ChartIndicatorAdd( 0, 0, ma_handle );
      }

Mikhail