The first thing you do when coding an EA is junk any Crap Custom Abortions you may have on your chart.
You might have a mtfStochastic, or a mtfBands, or a mtfMovingAverage etc. All they do is interrogate the standard indis shipped with Empty4 and present the information in a pretty way. The attached 'The problem with custom indis' explains why they are a waste of time when it comes to coding an EA.
Instead, you create your own reusable code to read the indi you already have on your crapform. Here is the documentation for calling the Stochastic indi:
double iStochastic(
string symbol, // symbol
int timeframe, // timeframe
int Kperiod, // K line period
int Dperiod, // D line period
int slowing, // slowing
int method, // averaging method
int price_field, // price (Low/High or Close/Close)
int mode, // line index
int shift // shift
);
So, you create your own function to read Stochastic under a wide range of circumstances. Here is one:
Code: Select all
double GetStochastic(string symbol, int tf, int k, int d, int s, int method, int pf, int mode, int shift)
{
return(iStochastic(symbol, tf, k, d, s, method, pf, mode, shift) );
}//End double GetStochastic(string symbol, int tf, int d, int s, int method, int mode, int shift)
Then, whenever you want your EA to read Stochastic, you send a call to your function with the relevant parameters. These can be hard coded or extern inputs.
The point is you are avoiding the bollocks of the Crap Custom Abortion that was probably coded by a cretin
and have a function you can copy/paste time and time and time again.
Indicators coded by members of SHF are not Crap Custom Abortions and you can trust them. The SHF no-bollocks-allowed policy has weeded out the dimwits long before you got here.

You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed
Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.