# Experts: My first EA based on Stochastic

1458

If you have any idea to improve, please let

Thanks

619

Hey jmhendrix1983

Regards

Huckleberry

1458

Thanks Huckleberry,

I´m working in a new one, using at least 3 indicator to identify the best signal..

i´m still learnig english... i will try put all comment on english

16319

how is "signal" calculated?

can you create something like EA to buy/sell if 1hour and 4 hour stochastics are below20/over 70? thank you

1458

diage:

how is "signal" calculated?

can you create something like EA to buy/sell if 1hour and 4 hour stochastics are below20/over 70? thank you

To purchase a sign, the sign of the Stochastic is rising in Timeframes M5, M15, M30,

the converse for sale

to 1 hour and 4 hour, change that code on bold = timeframe

STOM5ValueS0 = iStochastic(Symbol(),60,5,3,3,MODE_SMA,1,MODE_MAIN,0);
STOM5SignalS0 = iStochastic(Symbol(),60,5,3,3,MODE_SMA,1,MODE_SIGNAL,0);
STOM5ValueS1 = iStochastic(Symbol(),60,5,3,3,MODE_SMA,1,MODE_MAIN,Shift);
STOM5SignalS1 = iStochastic(Symbol(),60,5,3,3,MODE_SMA,1,MODE_SIGNAL,Shift);

STOM15Value = iStochastic(Symbol(),240,5,3,3,MODE_SMA,1,MODE_MAIN,0);
STOM15Signal = iStochastic(Symbol(),240,5,3,3,MODE_SMA,1,MODE_SIGNAL,0);
STOM30Value = iStochastic(Symbol(),1440,5,3,3,MODE_SMA,1,MODE_MAIN,0);
STOM30Signal = iStochastic(Symbol(),1440,5,3,3,MODE_SMA,1,MODE_SIGNAL,0);

 PERIOD_M1 1 1 minute. PERIOD_M5 5 5 minutes. PERIOD_M15 15 15 minutes. PERIOD_M30 30 30 minutes. PERIOD_H1 60 1 hour. PERIOD_H4 240 4 hour. PERIOD_D1 1440 Daily. PERIOD_W1 10080 Weekly. PERIOD_MN1 43200 Monthly.

below20/over 70

if (STOM5ValueS0 > STOM5SignalS0 && STOM5Signal < 20 && STOM5ValueS1 < STOM5SignalS1 && STOM15Value > STOM15Signal && STOM30Value > STOM30Signal)
{
Direcao = 1;
}
else if (STOM5ValueS0 < STOM5SignalS0 && STOM5Signal > 70 && STOM5ValueS1 > STOM5SignalS1 && STOM15Value < STOM15Signal && STOM30Value < STOM30Signal)
{
Direcao = 2;
}
else
{
Direcao = 0;
}
return (Direcao);

84

I do not understand why is there a Sleep command in yor code - which is after the Return command.

This way, the Sleep command will never work.

By the way, I am having a problem of my own: When I try to get the iStochastic with a Shift (i.e. other than 0), I get the same exact results for many ticks. Have you found a solution fot this problem?

84

Why is there a Sleep command after Return? It will never execute...

84

jmhendrix1983:

If you have any idea to improve, please let

Thanks

Why is there a Sleep command after Return? It will never execute...

1458

zevbn:
jmhendrix1983:

If you have any idea to improve, please let

Thanks

Why is there a Sleep command after Return? It will never execute...

its right, delete him

i´m still learning MQ4

16