Hello!
Im developing a automated trading platform and right now im trying to make some simple indicators.
I tryied to make a simple stochastic using a %K and %D lines, and using the following formula for the %K:
( ( Today's Close - Lowest Low in %K Periods ) / ( Highest High in %K Periods - Lowest Low in %K Periods ) ) * 100
The problem is a cant make it look as it does on other trading platforms, like Metatrader, and my best guess is that im missing something in the formula because i tried other indicators and they work just fine.
The function looks too squared, as if the metatrader one had a average or something applied to the %K =S.
Thanks in advance.I see it is reversed wiliams percent range formula:
Today's Close - Lowest Low in %K Periods
vs
Highest High in %K Periods -Today's Close
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 1
#property indicator_style1 STYLE_SOLID
#property indicator_level1 0
//---- indicator parameters
extern int WPRPeriod = 10;
extern int CountBars = 1500;
//---- indicator buffers
double ind_buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
//---- indicator buffers mapping
SetIndexBuffer(0,ind_buffer1);
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| WPR |
//+------------------------------------------------------------------+
int start()
{
int i, limit=CountBars;
if (limit>Bars) limit=Bars-WPRPeriod;
for(i=0; i<limit; i++)
{
ind_buffer1=iWPR(NULL,0,WPRPeriod, i)+100;
}
//---- done
return(0);
}Raff
- 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!
Im developing a automated trading platform and right now im trying to make some simple indicators.
I tryied to make a simple stochastic using a %K and %D lines, and using the following formula for the %K:
( ( Today's Close - Lowest Low in %K Periods ) / ( Highest High in %K Periods - Lowest Low in %K Periods ) ) * 100
The problem is a cant make it look as it does on other trading platforms, like Metatrader, and my best guess is that im missing something in the formula because i tried other indicators and they work just fine.
The function looks too squared, as if the metatrader one had a average or something applied to the %K =S.
Thanks in advance.