Coding help - page 712

 
mladen:
The method is exactly the same - just change the target window in the ChartIndicatorAdd() to be 0

Hi mladen,  thanks for the reply...  I was studying here.. 

ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA1Handle);

where  (1) top window 

CharGetInteger(1=>top window)

where  (0) below 

ChartIndicatorAdd(0,(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL),RSI1Handle);
CharGetInteger(0=>below)

not easy to discovery this.. lol

now I trying to put different color in the MA
 
baraozemo:

Hi mladen,  thanks for the reply...  I was studying here.. 

ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA1Handle);

where  (1) top window 

CharGetInteger(1=>top window)

where  (0) below 

ChartIndicatorAdd(0,(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL),RSI1Handle);
CharGetInteger(0=>below)

not easy to discovery this.. lol

now I trying to put different color in the MA

Like this

ChartIndicatorAdd(0,0,MA1Handle);
 
mladen:

Like this

ChartIndicatorAdd(0,0,MA1Handle);

the question about put the indicator on the top or below , as I said , I discovered... 

ChartIndicatorAdd(0,1,MA1Handle);   (top)

 ChartIndicatorAdd(0,2,RS1Handle);   (below)   

 

the actual problems: 

1) now I'm tryng to apply different color to the MA's

2) and solve a problem to release the MA's from the graphics (the RSI's and the WPR are cleaned correctly.. )

for example...

the RSI1,RSI2,RSI3 and WPR is cleaned correctly  but the MA1,MA2,MA3 is not cleaned...

 

int OnInit()

  {

  

  if (_Period==Signal_0_MA_Timeframe)  

   {

   MA1Handle = iMA(_Symbol,Signal_0_MA_Timeframe,Signal_0_MA_PeriodMA,Signal_0_MA_Shift,Signal_0_MA_Method,Signal_0_MA_Applied);

   if (MA1Handle!=INVALID_HANDLE)

      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA1Handle);

      //return(INIT_SUCCEEDED);

   }

  

  //---adicionando MA2

  if (_Period==Signal_1_MA_Timeframe)

   {

   MA2Handle = iMA(_Symbol,Signal_1_MA_Timeframe,Signal_1_MA_PeriodMA,Signal_1_MA_Shift,Signal_1_MA_Method,Signal_1_MA_Applied);

   if (MA2Handle!=INVALID_HANDLE)

      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA2Handle);

      //return(INIT_SUCCEEDED);      

   }   



===============================//===========================


//+------------------------------------------------------------------+

//| Deinitialization function of the expert                          |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   //limpa do gráfico os indicadores RSI e WPR

    for (int w = (int)ChartGetInteger(0,CHART_WINDOWS_TOTAL); w>=0; w--)

   {

      string name = ChartIndicatorName(0,w,0);

      if (StringFind(name,"RSI(",0)==0)

            ChartIndicatorDelete(0,w,name);

      if (StringFind(name,"%R(",0)==0)

            ChartIndicatorDelete(0,w,name);

      if (StringFind(name,"Moving Average(",0)==0)

            ChartIndicatorDelete(0,w,name);

   }         

   

   ExtExpert.Deinit();

  }

 
baraozemo:

the question about put the indicator on the top or below , as I said , I discovered... 

ChartIndicatorAdd(0,1,MA1Handle);   (top)

 ChartIndicatorAdd(0,2,RS1Handle);   (below)   

 

the actual problems: 

1) now I'm tryng to apply different color to the MA's

2) and solve a problem to release the MA's from the graphics (the RSI's and the WPR are cleaned correctly.. )

for example...

the RSI1,RSI2,RSI3 and WPR is cleaned correctly  but the MA1,MA2,MA3 is not cleaned...

 

int OnInit()

  {

  

  if (_Period==Signal_0_MA_Timeframe)  

   {

   MA1Handle = iMA(_Symbol,Signal_0_MA_Timeframe,Signal_0_MA_PeriodMA,Signal_0_MA_Shift,Signal_0_MA_Method,Signal_0_MA_Applied);

   if (MA1Handle!=INVALID_HANDLE)

      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA1Handle);

      //return(INIT_SUCCEEDED);

   }

  

  //---adicionando MA2

  if (_Period==Signal_1_MA_Timeframe)

   {

   MA2Handle = iMA(_Symbol,Signal_1_MA_Timeframe,Signal_1_MA_PeriodMA,Signal_1_MA_Shift,Signal_1_MA_Method,Signal_1_MA_Applied);

   if (MA2Handle!=INVALID_HANDLE)

      ChartIndicatorAdd(0,(int)ChartGetInteger(1,CHART_WINDOWS_TOTAL),MA2Handle);

      //return(INIT_SUCCEEDED);      

   }   



===============================//===========================


//+------------------------------------------------------------------+

//| Deinitialization function of the expert                          |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

   //limpa do gráfico os indicadores RSI e WPR

    for (int w = (int)ChartGetInteger(0,CHART_WINDOWS_TOTAL); w>=0; w--)

   {

      string name = ChartIndicatorName(0,w,0);

      if (StringFind(name,"RSI(",0)==0)

            ChartIndicatorDelete(0,w,name);

      if (StringFind(name,"%R(",0)==0)

            ChartIndicatorDelete(0,w,name);

      if (StringFind(name,"Moving Average(",0)==0)

            ChartIndicatorDelete(0,w,name);

   }         

   

   ExtExpert.Deinit();

  }

Sine moving average has only a name "Moving average" you can not uniquely identify it, so you can not safely delete it
 

Mladen,  1) please help make round digits in iCustom to 0.1 or 0.01 maximum. 

and explain, please how to insert "value2" (or3) instead of default indicator mean?

iCustom(symbolName,PeriodMinutes,"_1_IFT 2-1",0,i) 

 

HELLO mr mladen

i run this indicator{ssa_squeeze_of_averages_mtf_amp_alerts_2.mq4} but it can't show any thing

could you fix it

best regard

 

and could you make MTF of this indicator: ma_count_amp_alerts.mq4

MTF similar this histogram:

 

 
bilbao:

HELLO mr mladen

i run this indicator{ssa_squeeze_of_averages_mtf_amp_alerts_2.mq4} but it can't show any thing

could you fix it

best regard

 

and could you make MTF of this indicator: ma_count_amp_alerts.mq4

MTF similar this histogram:

 

You need "SSA of price" for the ssa_squeeze ... to work
 
kostumer27:

Mladen,  1) please help make round digits in iCustom to 0.1 or 0.01 maximum. 

and explain, please how to insert "value2" (or3) instead of default indicator mean?

iCustom(symbolName,PeriodMinutes,"_1_IFT 2-1",0,i)

Depends on the parameters list of the indicator, but you have to pass the parameters in between the indicator name and the buffer number

Something like this :

iCustom(symbolName,PeriodMinutes,"_1_IFT-1",yourParameter1,yourParameter2,yourParameter3,yourParameter9999,0,i)

The other part, I do not understand

If you mean hot to limit the return values, you can not do that. You can only limit the value assigned to something from the iCustom() call, like this

double result = MathMax(MathMin(iCustom(symbolName,PeriodMinutes,"_1_IFT 2-1",0,i),0.1),0.01);
 
mladen:
You need "SSA of price" for the ssa_squeeze ... to work

thanks.

now it work 

 

mr mladen :

could make MTF of it

similar this picture histogram

best regard

 

Files: