bonjour à tous
j'ai bricolé un petit indicateur, qui donne le volume M5 en M1 c'est tout bête mais ça donne un meilleur suivi, en particulier lorsque l'on cherche des correlations .
image de gauche le volume en M5 et à droite le volume m5 sur m1.
je suis une bille en codage alors veuillez excuser le bricolage grossier ...(formule modifiée sur un bulls), d'ailleurs si quelqu'un se sent motivé ...
//+------------------------------------------------------------------+
//| V5on1.mq4 |
//| Fog |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Orange
#property indicator_width1 3
//---- input parameters
extern int BullsPeriod=13;
//---- buffers
double BullsBuffer[];
double TempBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 1 additional buffer used for counting.
IndicatorBuffers(2);
IndicatorDigits(Digits);
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,BullsBuffer);
SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label
short_name="V5on1("+BullsPeriod+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Bulls Power |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
if(Bars<=BullsPeriod) return(0);
//----
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;
for(i=0; i<limit; i++)
TempBuffer[i]=iMA(NULL,0,BullsPeriod,0,MODE_EMA,Volume,i);
//----
i=Bars-counted_bars-1;
while(i>=0)
{
BullsBuffer[i]=Volume[i]+Volume[i+1]+Volume[i+2]+Volume[i+3]+Volume[i+4];
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
j'ai bricolé un petit indicateur, qui donne le volume M5 en M1 c'est tout bête mais ça donne un meilleur suivi, en particulier lorsque l'on cherche des correlations .
image de gauche le volume en M5 et à droite le volume m5 sur m1.
je suis une bille en codage alors veuillez excuser le bricolage grossier ...(formule modifiée sur un bulls), d'ailleurs si quelqu'un se sent motivé ...
//+------------------------------------------------------------------+
//| V5on1.mq4 |
//| Fog |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Orange
#property indicator_width1 3
//---- input parameters
extern int BullsPeriod=13;
//---- buffers
double BullsBuffer[];
double TempBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 1 additional buffer used for counting.
IndicatorBuffers(2);
IndicatorDigits(Digits);
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,BullsBuffer);
SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label
short_name="V5on1("+BullsPeriod+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Bulls Power |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
if(Bars<=BullsPeriod) return(0);
//----
int limit=Bars-counted_bars;
if(counted_bars>0) limit++;
for(i=0; i<limit; i++)
TempBuffer[i]=iMA(NULL,0,BullsPeriod,0,MODE_EMA,Volume,i);
//----
i=Bars-counted_bars-1;
while(i>=0)
{
BullsBuffer[i]=Volume[i]+Volume[i+1]+Volume[i+2]+Volume[i+3]+Volume[i+4];
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+