Индикаторы: Momentum

 

Momentum:

Индикатор Темпа (Momentum) измеряет величину изменения цены финансового инструмента за определенный период.

Author: MetaQuotes Software Corp.

 
А где к нему прикрутить string Symbols="EURUSD", например?
 
//+------------------------------------------------------------------+
//| Momentum.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- input parameters
extern int MomPeriod=14;
extern string Symbols="EURUSD";
// Symbols определяет валютную пару.
// Используйте NULL (или 0), если вам нужен текущий (активный) инструмент (график).
//---- buffers
double MomBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name="";
short_name="Mom("+MomPeriod+", "+Symbols+") = ";
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,MomBuffer);
SetIndexLabel(0,short_name);
SetIndexDrawBegin(0,MomPeriod);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName(short_name);
IndicatorDigits(1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Momentum |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
if(Bars<=MomPeriod) return(0);
//---- initial zero
if(counted_bars<1)
for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0;
//----
i=Bars-MomPeriod-1;
if(counted_bars>=MomPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
if(iClose(Symbols,0,i+MomPeriod)!=0)
MomBuffer[i]=iClose(Symbols,0,i)*100/iClose(Symbols,0,i+MomPeriod);
else MomBuffer[i]=EMPTY_VALUE;
i--;
}
return(0);
}
//+------------------------------------------------------------------+