Download MetaTrader 5
To add comments, please log in or register
Launch agents on an idle PC. It is profitable!
MetaQuotes Software Corp.
Moderator
177241
MetaQuotes Software Corp. 2009.07.02 07:10 

My first EA based on Stochastic:

using Stochastic m5, m15 and m30

Author: Rafael Maia de Amorim

Rafael Maia de Amorim
1423
Rafael Maia de Amorim 2009.07.02 14:49  

If you have any idea to improve, please let



Thanks

Ben
618
Ben 2009.07.03 01:11  

Hey jmhendrix1983

Nice work. Wish that I could read your comments. Different lanugage you know. Thank you again for your advise and help on my learning curve.

Regards

Huckleberry

Rafael Maia de Amorim
1423
Rafael Maia de Amorim 2009.07.03 02:56  

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

MQL4 Comments
16309
MQL4 Comments 2009.07.03 04:43  

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

Rafael Maia de Amorim
1423
Rafael Maia de Amorim 2009.07.03 16:56  
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);


zeev
84
zeev 2009.07.06 12:55  

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?

zeev
84
zeev 2009.07.06 14:02  

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

zeev
84
zeev 2009.07.06 14:03  
jmhendrix1983:

If you have any idea to improve, please let



Thanks

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

Rafael Maia de Amorim
1423
Rafael Maia de Amorim 2009.07.06 14:36  
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

fxmelvin
16
fxmelvin 2009.07.10 09:56  

please how do i download this EA to my expert advisor in my navigation window.

/ /123
To add comments, please log in or register