Hello
I am new on this forum and generally on mql4 : I am studying a program that I found on the web and could not understand how the function iForce works. My intention is to write an EA on the forex, and I was surprised to lear that on forex for mql4, the volume is the number of ticks in the bar.
Can somebody give me any advice about iForce especially if it uses the Force_Index as described in
https://www.mql5.com/en/code/8013
Thank you for your support, and your answers.
Be successfull in your trades.
Read the code
//+------------------------------------------------------------------+ //| Force Index.mq4 | //| Copyright © 2005, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- input parameters extern int ExtForcePeriod=13; extern int ExtForceMAMethod=0; extern int ExtForceAppliedPrice=0; //---- buffers double ExtForceBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string sShortName; SetIndexBuffer(0,ExtForceBuffer); //---- indicator line SetIndexStyle(0,DRAW_LINE); //---- name for DataWindow and indicator subwindow label sShortName="Force("+ExtForcePeriod+")"; IndicatorShortName(sShortName); SetIndexLabel(0,sShortName); //---- first values aren't drawn SetIndexDrawBegin(0,ExtForcePeriod); //---- return(0); } //+------------------------------------------------------------------+ //| Force Index indicator | //+------------------------------------------------------------------+ int start() { int nLimit; int nCountedBars=IndicatorCounted(); //---- insufficient data if(Bars<=ExtForcePeriod) return(0); //---- last counted bar will be recounted if(nCountedBars>ExtForcePeriod) nCountedBars--; nLimit=Bars-nCountedBars; //---- Force Index counted for(int i=0; i<nLimit; i++) ExtForceBuffer[i]=Volume[i]* (iMA(NULL,0,ExtForcePeriod,0,ExtForceMAMethod,ExtForceAppliedPrice,i)- iMA(NULL,0,ExtForcePeriod,0,ExtForceMAMethod,ExtForceAppliedPrice,i+1)); //---- done return(0); } //+------------------------------------------------------------------+
ExtForceBuffer[i]=Volume[i]* (iMA(NULL,0,ExtForcePeriod,0,ExtForceMAMethod,ExtForceAppliedPrice,i)- iMA(NULL,0,ExtForcePeriod,0,ExtForceMAMethod,ExtForceAppliedPrice,i+1));
This is the part you wanna know what it is doing.....
So it has to do with Volume bar i and with Moving Average Bar i and Moving Average Bar i+1
Now for you to give in your own words what you think the indicator is doing......
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello
I am new on this forum and generally on mql4 : I am studying a program that I found on the web and could not understand how the function iForce works. My intention is to write an EA on the forex, and I was surprised to lear that on forex for mql4, the volume is the number of ticks in the bar.
Can somebody give me any advice about iForce especially if it uses the Force_Index as described in
https://www.mql5.com/en/code/8013
Thank you for your support, and your answers.
Be successfull in your trades.