| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (5) | Thread Tools | Display Modes |
|
||||
|
It could look like and the code could be similar but they´re different, values are different.
__________________
|
|
||||
|
For Williams % Range it's iWPR(string symbol, int timeframe, int period, int shift). To get the help on this from MetaEditor type "iWPR" in your expert and then press F1 which will pull up the Toolbox with the syntax, parameters to pass to the function and an example piece of code.
__________________
You can find me on irc.ircforex.com most of the time... on #forex Myspace Facebook My Indicators: Trade Assistant Trend Friend ToR CCI Helper Holder of US Patent 6,774,788 |
|
||||
|
Williams R% explanation post #14
%R = (HIGH(i-n)-CLOSE)/(HIGH(i-n)-LOW(i-n))*100 Code:
//+------------------------------------------------------------------+
//| Williams’ Percent Range.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_minimum -100
#property indicator_maximum 0
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_level1 -20
#property indicator_level2 -80
//---- input parameters
extern int ExtWPRPeriod = 14;
//---- buffers
double ExtWPRBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string sShortName;
//---- indicator buffer mapping
SetIndexBuffer(0, ExtWPRBuffer);
//---- indicator line
SetIndexStyle(0, DRAW_LINE);
//---- name for DataWindow and indicator subwindow label
sShortName="%R(" + ExtWPRPeriod + ")";
IndicatorShortName(sShortName);
SetIndexLabel(0, sShortName);
//---- first values aren't drawn
SetIndexDrawBegin(0, ExtWPRPeriod);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Williams’ Percent Range |
//+------------------------------------------------------------------+
int start()
{
int i, nLimit, nCountedBars;
//---- insufficient data
if(Bars <= ExtWPRPeriod)
return(0);
//---- bars count that does not changed after last indicator launch.
nCountedBars = IndicatorCounted();
//----Williams’ Percent Range calculation
i = Bars - ExtWPRPeriod - 1;
if(nCountedBars > ExtWPRPeriod)
i = Bars - nCountedBars - 1;
while(i >= 0)
{
double dMaxHigh = High[Highest(NULL, 0, MODE_HIGH, ExtWPRPeriod, i)];
double dMinLow = Low[Lowest(NULL, 0, MODE_LOW, ExtWPRPeriod, i)];
if(!CompareDouble((dMaxHigh - dMinLow), 0.0))
ExtWPRBuffer[i] = -100*(dMaxHigh - Close[i]) / (dMaxHigh - dMinLow);
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Функция сранения двух вещественных чисел. |
//+------------------------------------------------------------------+
bool CompareDouble(double Number1, double Number2)
{
bool Compare = NormalizeDouble(Number1 - Number2, 8) == 0;
return(Compare);
}
//+------------------------------------------------------------------+
__________________
|
|
|||
|
Thanks for everybody's help on both help questions - The reference and also the complete code of the Williams % Retracement. Now I can proceed ahead with my EA. Thumbs up and much blessings for all your combined help!
Peace and Friendship! Dave |
|
|||
|
Dynamic Momentum Index (T. Chande)
Hi,
i´m looking for the "Dynamic Momentum Index" from Trushar Chande for MT4. Google didn´t help me, can you? (it is not the standard DMI.mq4 which is the "Directional Movement Index") (and it is not there: Indicator Requests for EA. ) Thank You, bbop Last edited by BigBoppa; 04-18-2008 at 11:38 PM. |
|
||||
|
Quote:
__________________
|
![]() |
| Bookmarks |
| Tags |
| histogram |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/digital-filters/57-filters-indicators.html
|
||||
| Posted By | For | Type | Date | |
| WildersDMI_v1 - MQL4 Code Base | Post #102 | Refback | 05-23-2008 11:47 PM | |
| MTF_WildersDMI_v1m - MQL4 代ç 基地 | Post #52 | Refback | 04-24-2008 12:23 AM | |
| MTF_WildersDMI_v1m - MQL4 Code Base | Post #52 | Refback | 04-21-2008 05:41 PM | |
| MTF_WildersDMI_v1m - MQL4 Code Base | Post #52 | Refback | 04-21-2008 12:58 PM | |
| MTF_WildersDMI_v1m - MQL4 Code Base | Post #52 | Refback | 04-19-2008 04:29 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Candel Sticks Indecator and Filters | Oracle | Indicators - Metatrader 4 | 19 | 04-13-2008 01:55 PM |
| Filters' Trading System | newdigital | Manual trading systems | 23 | 01-02-2006 02:26 PM |
| digital filters | newdigital | Indicators - Metatrader 3 | 3 | 12-07-2005 07:18 AM |
| Digital filters | newdigital | Documentation | 4 | 12-02-2005 06:04 PM |