Results 1 to 7 of 7
  16 16 Attachment(s)    

Thread: Second stochs EA Idea

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    13

    Default Second stochs EA Idea

    I'd like some help to create an EA I use to catch the second or third leg of a trend, originally recommended by Fxbootcamp.


    The strategy is the second stochastic cross(at candle close) above the oversold line and after MACD has gone that way. I use this strategy as a confirmation for trades I've already planned, but I think it might be viable as a standalone Expert Advisor. Like most EA's though, it will not be profitable in a consolidating market. Therefore, before making a trade, it must refer to the MACD histogram(called value3 in the template) from the previous candle. If it greater than value X(for a long) or -X (for a short), the trade would be made. Obviously that histogram value will have to be entered by the user based on time frame and risk profile. Even better if it can have a filter for market direction such as 21ema above/below the 55ema. I don't have the mql4 knowledge to program this yet, but I'm working on it.

    I've attached an example picture on a 15m chart where the macd histogram value would be -0.000169. At the time, however, that value would not have been known, as the candle had not formed yet. The previous candle was a known value, though, which in this case was -0.000121. That is the candle that must be above value X/-X.

    I would generally close half position at 20 pips, and rest at next macd cross, but it may work better in some cases just to take 20pips. Either way, I'd really like to play with it and if I get settings right, I'll share them.

    All values user-selectable, but below are the values I use.

    MACDCorrect 21,55,8
    Stochastics 8,3,5
    EMAs 21, 55

    Attachments are a template and 2 indis, since the fxb-clean template uses the EX4, I have included that, but obviously the modifiable one is MACDcorrect.mq4

    Thanks in advance.
    Attached Images Attached Images Second stochs EA Idea-example-2155-jpg 
    Attached Files Attached Files

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Hi Bredman,

    Here is an EA.

    I'm not sure to understand what you consider as a "second stochastic cross",

    If the first cross is an up cross under the oversoldline and the second cross is a down cross over the oversoldline we go short and :

    If the first cross is a down cross over the overboughtline and the second cross is an up cross under the overboughtline we go short ?

    Can the second cross be over the overboughtline for sell and under the oversoldline for buy ?
    Attached Files Attached Files

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    13

    Default

    Hi Funyoo,

    Thanks for the response.

    For a long we need the following conditions:

    MACD histogram < 0.0001 (default)
    Stochastics below 80(default) and crossing up
    EMA filter: 21 above the 55

    For a short, the opposite:
    MACD histogram >-0.0001(default)
    Stochastics above 20(default) and crossing down
    EMA Filter: 21 below the 55

    Stochastics really is the trigger for this EA, with the MACD and EMAs just being filters.

    You have done well, and the system is generally profitable for pairs such as EY 15m with a 21 pip TP. There are a few trades that I've noticed it does not take which appear to be good according to the settings. I've been watching it in visual mode but I can't figure out why...

    One thing that might help is an option to close all at next MACD cross, as many trends have much farther to go before consolidating.

    So for long, close when macdlevelup < 0
    and for short, close when macdleveldn > 0
    ...I think.

    Thanks again.

    And here is a sample report and a picture that may be more descriptive of what is going on.
    Attached Images Attached Images Second stochs EA Idea-gu15m-gif Second stochs EA Idea-2ndstochseamod-jpg 
    Attached Files Attached Files

  4. #4
    Junior Member
    Join Date
    Oct 2009
    Posts
    13

    Default

    Some more tests, and a bump

    EY seems to be the most consistant pair I've tested so far. Here are some backtests on 15m and 1h.
    Attached Images Attached Images Second stochs EA Idea-ey1h-optimized-gif 
    Attached Files Attached Files

  5. #5
    Junior Member
    Join Date
    Oct 2009
    Posts
    13

    Default

    And another set.

    Funyoo: I know you're busy, but could you take a pass at adding the "close at next MACD cross" option?

    Thanks
    Attached Images Attached Images Second stochs EA Idea-ey15m-13k-gif 
    Attached Files Attached Files

  6. #6
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by Bredman View Post
    And another set.

    Funyoo: I know you're busy, but could you take a pass at adding the "close at next MACD cross" option?

    Thanks
    Hi Bredman,

    Ok, the entry logics were not clear.

    Here is a new version with the exit rule.
    Attached Files Attached Files

  7. #7
    Junior Member
    Join Date
    Oct 2009
    Posts
    13

    Default

    Thanks Funyoo.

    I've modified it to the initial order entry rules, as the second set made multiple trades at the same MACD direction. This version, however, has the MACD x exit rules.

    Doesn't seem like anyone else is testing it with me, but just in case...
    Attached Files Attached Files

Similar Threads

  1. Double MTF Stochs EA
    By senaka7 in forum Ideas for expert advisors
    Replies: 7
    Last Post: 04-29-2017, 12:33
  2. Ten Stochs Wave EA
    By funyoo in forum Expert advisors backtesting
    Replies: 108
    Last Post: 02-01-2015, 17:28
  3. Ten Stochs Wave EA
    By funyoo in forum Expert advisors live statements
    Replies: 14
    Last Post: 08-21-2010, 21:44
  4. An idea? or not?
    By shaya in forum Ideas for expert advisors
    Replies: 5
    Last Post: 10-25-2009, 19:40
  5. 2 time frame stochs filter
    By automatic in forum Ideas for expert advisors
    Replies: 1
    Last Post: 12-19-2008, 19:11

Tags for this Thread

advisor, candle, ex4, expert, expert advisor, macd, mql, mql4, pips, profitable, sample, stochastic, strategy, system, time, trend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •