MOVING AVERAGES IN SEPARATE INDICATOR WINDOW

 

Hello

may I know how to add the moving averages to a separate window as below screenshot?

..

I am not asking to how add it manually, I am asking for coding

 

#property  indicator_separate_window

If you want the MA applied to another indicator's values use iMAOnArray()
 
Keith Watford:

#property  indicator_separate_window

If you want the MA applied to another indicator's values use iMAOnArray()


thanks my friend

but I want in EAs

see the set file below

 

something like the below for trading:

if(iMA(....)>20)   OrderSend(....);
 
Hello!
 

Hey all, I have the same question here.

Scenario : 

I want to add Moving Average inside Stochastic Indicators (Use First Indicators Data) in my Expert Adviser.

I need the code. How can I add  --> ENUM_APPLIED_PRICE = First Indicator's Data for Moving Average since is not available.

//============= Stochastic Params ==============

extern int StochPeriod ;

extern int RSIPeriod ;

extern int RSIPrice;

extern int SmoothingPeriod;

extern int SmoothingMethod;

extern int BandsPeriod;

extern double BandsDeviation;

extern bool ShowBands;

extern ENUM_TIMEFRAMES timeFrame = PERIOD_CURRENT;

extern ENUM_MA_METHOD Ma_Method = MODE_SMMA;

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

void OnTick()

  {

double iCustomSTO = iCustom(_Symbol,PERIOD_CURRENT,"StochasticRSI_",

  StochPeriod,RSIPeriod,RSIPrice,SmoothingPeriod,SmoothingMethod,

  BandsPeriod,BandsDeviation,ShowBands,timeFrame,3);

  double iMAST = iMA(_Symbol,PERIOD_CURRENT,20,0,Ma_Method,iCustomSTO,0);

Print("iCustomSTO= ",iCustomSTO," --- iMAST= ",iMAST);

}

Result:


USDCHF,H1

Date 2018.09.14

Time 16:00

Open 0.96611

High 0.96685

Low 0.96571

Close 0.96650

Volume 4501

Indicator window 1

StochRSI midle band 40.3200

StochRSI upper band 56.8599

StochRSI lower band 23.7801

StochRSI 57.3127




Note : The Stochastic Indicator has four buffer the latest one ->STORSI is Number 3 which I mentioned in iCustome mode as 3.

I have passed the Value of Stochastic indicator to Moving Average but it show this result to me :

 

Write an indicator that plots all the lines that you require.

If you want an MA of another line (buffer) use iMAOnArray().

Use iCustom() to get the values from the indicator

 
Keith Watford:

Write an indicator that plots all the lines that you require.

If you want an MA of another line (buffer) use iMAOnArray().

Use iCustom() to get the values from the indicator

First of all, thanks for reply.

iMAOnArray() need an Array as input but how can I pass the desired line or buffer ( StochRSI  = which is buffer Index=3 ) as an array?
 

First of all - do not double post. I have removed your other topic.

A buffer is an array.

Reason: