preFormula tends either to zero or to infinity anyway depending on whether or not
the first argument of MathPow() is less then 1,
unless AvgVolu is reasonably close to 1.
Have you ever heard of the properties of exponential function?
The problem in you calculations is fundamental I'm afraid.
its working. However, it is not updating on each tick received. thereforei have
to load it every time....very annoying. can u see why the indicator is not drawing
for each tick? i'm stumped.
#propertycopyright"Metatrader4 Code by jjk2. Based on MBA Thesis from Simon Fraser University written by C.E. ALDEA."#propertylink""#propertyindicator_separate_window#propertyindicator_buffers1#propertyindicator_color1Green//---- buffersdoubleExtMapBuffer1[];
doubleExtMapBuffer2[];
doubleAvgVol[];
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intinit(){//---- indicator drawingIndicatorBuffers(2);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_NONE);//DRAW_NONE,EMPTY,EMPTY);SetIndexBuffer(1,ExtMapBuffer2);
///-----Name of Indicator stringshort_name = "MBA Thesis Thing using Average Volume Current value calculated by indicator:";
IndicatorShortName(short_name);
ArrayResize(AvgVol,Bars - 1);
//----return(0);
}//+------------------------------------------------------------------+//| Custom indicator deinitialization function |//+------------------------------------------------------------------+intdeinit(){//----//----return(0);
}//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intstart(){intcounted_bars = IndicatorCounted();
intpos = Bars - counted_bars - 9;
inttemp = pos;
//----if(counted_bars<0)return(-1);
if(counted_bars>0)counted_bars--;
while(pos>0){//string xxx = "pos"; doubleMACD = iMACD(NULL,0,12,26,9,PRICE_CLOSE,0,pos);
doubleStoch = iStochastic(NULL,0,9,6,2,MODE_SMA,1,0,pos);
doubleRSI = iRSI(NULL,0,9,PRICE_CLOSE,pos);
doublemoment = iMomentum(NULL,0,9,PRICE_CLOSE,pos);
//double Volu = iMA(NULL,0,9,0,MODE_SMA,MODE_VOLUME,pos); //iVolume(NULL,0,pos);//AvgVol[pos] = Volu;//double VolMax = AvgVol[ArrayMaximum(AvgVol,9,pos)];//double VolMin = AvgVol[ArrayMinimum(AvgVol,9,pos)];//double NormVol = (VolMax - Volu) / (VolMax - VolMin);doubleVol = iMA(NULL,0,9,0,MODE_SMA,MODE_VOLUME,pos);
doubleAvgVol = Volume[pos]/Vol;
//Main Forumla//double preFormula = (/Momentum);if(moment != 0)ExtMapBuffer2[pos] = MathPow(Stoch*(RSI+MACD)/moment,AvgVol);
pos--;
}while(temp > 0){doubleFormula = iMAOnArray(ExtMapBuffer2,0,3,0,MODE_SMA,temp);
ExtMapBuffer1[temp] = Formula;
temp--; }//----return(0);
}//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If you change
to
it will draw the horizontal line. It appears that iMomentum indicator has a problem with a number of bars interger assigned to a name (pos).
This is a good one for Slawa or Rosh to resolve
Wackena
okay im trying to normalize, the Volume.
is this correct? however, i am getting unexpected semicolon error when i compile.
is this correct?
preFormula tends either to zero or to infinity anyway depending on whether or not the first argument of MathPow() is less then 1,
unless AvgVolu is reasonably close to 1.
Have you ever heard of the properties of exponential function?
The problem in you calculations is fundamental I'm afraid.
i am getting unexpected semicolon error when i compile.
thanks its working now. after the volume was normalized with the help of others, its able to graph.
heres the thread where u can see the screenshot. if u want, i can anyone who wants to work on it hte code.
https://www.forex-tsd.com/145114-post5.html
its working. However, it is not updating on each tick received. thereforei have to load it every time....very annoying. can u see why the indicator is not drawing for each tick? i'm stumped.