# Stochastic Oscillator, the beginning - page 4

6

Calculate Stochastic Formula on a array (non indicator buffer array) - is iStochastic

Hi,

I need to calculate the stochastic formula on a array, this array is not a indicator buffered array. This is my code:

double

SmallestBuffer[],

LargestBuffer[],

COTIndex[];

int

COTIndexPeriod=13, //similar to Stochastic %K period

position=0;

ArrayResize(SmallestBuffer, ArraySize(Commercial));

ArrayResize(LargestBuffer, ArraySize(Commercial));

ArrayResize(COTIndex, ArraySize(Commercial));

for (i= ArraySize(Commercial)-COTIndexPeriod; i >= 0; i--)

{

position = ArrayMinimum(Commercial, COTIndexPeriod, i+COTIndexPeriod-1);

SmallestBuffer = Commercial[position];

//Print("Smallest: ", SmallestBuffer, " Index: ", i);

}

for (i= ArraySize(Commercial)-COTIndexPeriod; i >= 0; i--)

{

position = ArrayMaximum(Commercial, COTIndexPeriod, i+COTIndexPeriod-1);

LargestBuffer = Commercial[position];

//Print("Largest: ", LargestBuffer, " Index: ", i);

}

for (i= ArraySize(Commercial)-COTIndexPeriod; i >= 0; i--)

//for (i= ArraySize(Commercial)-1; i > 0; i--)

{

//position = ArrayMaximum(Commercial, COTIndexPeriod, i+COTIndexPeriod-1);

double top = Commercial-SmallestBuffer;

double bottom = LargestBuffer-SmallestBuffer;

if(bottom == 0.0) //prevent divide by zero errors

{ bottom=100.0; }

COTIndex = (top/bottom)*100;

Print("COTIndex: ", COTIndex, " Index: ", i);

ExtMapBuffer1 = COTIndex; //graph it

}

So the goal is to have the Stochastic value stored in the COTIndex array. However, the calculated values are in incorrect. Does anyone have a Stochastic-On-Array (iStochOnArray) implementation? or maybe does anyone see where the logical problem is on my code? I'm stuck and would greatly appreciate any help!

Thank you

Mike

298

DigiStoch

I modified DigiStoch a little bit so you can choose mode sma, ema, smma, or lwma. And you get to choose high/low or close/close in the pricefield.

Files:
digistoch.mq4  21 kb
51

Files:
127

do you realise the Stoch can be placed — like all other indicators

in its own window below price bars

here's 3 Stoch indis all found on ForexTSD

Files:
82

Sexy Stochastics Indicator

Hi everyone, for people using the sexy stochastic strategy developped by Boxingislife this will be a big helper

You can find the strategy here :

bringin sexy back - stochastics

I have finally decided to release this indicator to the wild as i beleive that it is not the indicator that matters, it is the trader.

Attached is the indicator with the code. I have documented it pretty clearly but i intend to make a guide for it.

I has one issue i hope the community will solve. The alert and mail system is working but it sends 4 time the alert (one for each subsequent candle, see this topic )

Here is a picture of it

Files:
stoch.gif  37 kb
stochv.1.mq4  25 kb
369

There are too many indicators in the chart. He..he..hee

82

nicesurf:
There are too many indicators in the chart. He..he..hee

Yep sorry i forgot to remove the other indicator (they were temporary on a test chart )

My indicator is the signal with 1-2-3-4

Here is an updated screenshot. The signal is on the open of the current candle.

Files:
stoch_1.gif  16 kb
3203

Melpheos:
Hi everyone, for people using the sexy stochastic strategy developped by Boxingislife this will be a big helper

You can find the strategy here :

bringin sexy back - stochastics

I have finally decided to release this indicator to the wild as i beleive that it is not the indicator that matters, it is the trader.

Attached is the indicator with the code. I have documented it pretty clearly but i intend to make a guide for it.

I has one issue i hope the community will solve. The alert and mail system is working but it sends 4 time the alert (one for each subsequent candle, see this topic )

yepp, it's allready fixed on FF

Forex Factory - View Single Post - The sexy stochastic indicator

82