- Springfellow-Hawk
- Messages : 539
Date d'inscription : 08/11/2009
Age : 50
Localisation : South beach california
Normalized Volume.mq4
19/3/2010, 2:05 pm
Indic>1 en tendance
indic<1 flat , derive
//+------------------------------------------------------------------+
//| NormalizedVolume.mq4 |
//| Vadim Shumilov (DrShumiloff) |
//| shumiloff@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Vadim Shumilov (DrShumiloff)"
#property link "shumiloff@mail.ru"
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
extern int VolumePeriod = 8;
double VolBuffer[];
int init()
{
string short_name;
IndicatorBuffers(1);
SetIndexBuffer(1, VolBuffer);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, VolBuffer);
SetIndexDrawBegin(0, VolBuffer);
short_name="Normalized Volume(" + VolumePeriod + ")";
IndicatorShortName(short_name);
SetIndexLabel(0, short_name);
return(0);
}
int start()
{
int counted_bars = IndicatorCounted();
if (counted_bars < 1)
for (int i = 1; i <= VolumePeriod; i++) VolBuffer[Bars-i] = 0.0;
int limit = Bars - counted_bars;
if (counted_bars > 0) limit++;
for(i = 0; i < limit; i++)
{
VolBuffer[i] = NormalizedVolume(i);
}
return(0);
}
double NormalizedVolume(int i)
{
double nv = 0;
for (int j = 0; j < VolumePeriod; j++) nv = nv + Volume[j];
nv = nv / VolumePeriod;
return (Volume[i] / nv);
}
indic<1 flat , derive
//+------------------------------------------------------------------+
//| NormalizedVolume.mq4 |
//| Vadim Shumilov (DrShumiloff) |
//| shumiloff@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Vadim Shumilov (DrShumiloff)"
#property link "shumiloff@mail.ru"
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
extern int VolumePeriod = 8;
double VolBuffer[];
int init()
{
string short_name;
IndicatorBuffers(1);
SetIndexBuffer(1, VolBuffer);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(0, VolBuffer);
SetIndexDrawBegin(0, VolBuffer);
short_name="Normalized Volume(" + VolumePeriod + ")";
IndicatorShortName(short_name);
SetIndexLabel(0, short_name);
return(0);
}
int start()
{
int counted_bars = IndicatorCounted();
if (counted_bars < 1)
for (int i = 1; i <= VolumePeriod; i++) VolBuffer[Bars-i] = 0.0;
int limit = Bars - counted_bars;
if (counted_bars > 0) limit++;
for(i = 0; i < limit; i++)
{
VolBuffer[i] = NormalizedVolume(i);
}
return(0);
}
double NormalizedVolume(int i)
{
double nv = 0;
for (int j = 0; j < VolumePeriod; j++) nv = nv + Volume[j];
nv = nv / VolumePeriod;
return (Volume[i] / nv);
}
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|