Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  14 14 Attachment(s)    

Thread: MACD Reverse EA

  1. #11

    Default

    Quote Originally Posted by Straasha View Post
    Hi mariothegreat,

    I added the parameters MACD_Buy, MACD_Sell and the Time Filter function.
    Hi Thanks
    Tonight I'll have a look to it, I let you know
    Mario

  2. #12

    Default

    Quote Originally Posted by webicknell View Post
    Mario, nice results.

    Can you post you set files or give MACD levels for the different pairs?

    And you indicate and 8AM to 4 PM trading window... what time zone are you working with?

    Hi,
    I'm in London,
    Here below the modification I made, be careful you have to choose the right value of the macd for every couple of currency and for every different day!
    p.s.
    Remember I copied only to the point I modified...



    //+------------------------------------------------------------------+
    //| MACD Reverse EA.mq4 |
    //| Copyright 2007, Forex-Experts |
    //| http://www.forex-experts.com |
    //| Trend RDS modified by Mariothegreat |
    //+------------------------------------------------------------------+

    #property copyright "Copyright 2007, Forex-Experts"
    #property link "http://www.forex-experts.com"


    #define OrderStr "MACD Reverse EA"

    extern string MACD = "---------------- MACD";
    extern int MACD_Fast = 12;
    extern int MACD_Slow = 26;
    extern int MACD_Signal = 9;
    extern string Lot1 = "---------------- Lot Management";
    extern double Lots=1.0;
    extern double mm=0;
    extern double Risk=10;
    extern string Tstb = "---------------- TP SL TS BE";
    extern bool RealStopLoss_Enabled = false;
    extern int RealStopLoss = 5;
    extern bool RealTakeProfit_Enabled = false;
    extern int RealTakeProfit = 10;
    extern int StopLoss = 0;
    extern int TakeProfit = 0;
    bool TradeAtCloseBar = false;
    extern bool Reverse = false;
    extern int TrailingStop = 0;
    extern int TrailingStep = 1; //Trailing step
    extern int BreakEven = 0;
    extern string Extras = "---------------- Extras";
    extern bool CanAddPos=true;
    extern int MaxOpenOrders=1;
    extern int MagicNumber=0;
    //For alerts:
    extern int Repeat=3;
    extern int Periods=5;
    extern bool UseAlert=false;
    extern bool SendEmail=false;
    extern string
    TradeLog="MACD Reverse EA";


    extern int Slippage = 3;


    int Crepeat=0;
    int AlertTime=0;
    double AheadTradeSec = 0;
    double AheadExitSec = 0;
    int TradeBar = 0;
    double MaxTradeTime = 300;

    extern string
    Indicator_Setting = "---------- Indicator Setting";

    int
    NumberOfTries = 1, //Number of tries to set, close orders;
    RetryTime = 1;



    double
    Ilo = 0;

    int DotLoc=7;
    static int TradeLast=0;

    string sound="alert.wav";

    double sig_cur=0, sig_prev=0;

    int Spread=0;
    string filename="";

    //+------------------------------------------------------------------+
    //| expert initialization function |
    //+------------------------------------------------------------------+
    int init()
    {
    //----


    Crepeat=Repeat;
    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| expert deinitialization function |
    //+------------------------------------------------------------------+
    int deinit()
    {
    //----

    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| expert start function |
    //+------------------------------------------------------------------+
    int start()
    {
    if (TradeAtCloseBar) TradeBar=1;
    else TradeBar=0;

    filename=Symbol() + TradeLog + "-" + Month() + "-" + Day() + ".log";


    Spread=MarketInfo(Symbol(),MODE_SPREAD);


    //----
    int i=0;

    double BuyValue=0, SellValue=0;
    BuyValue=0; SellValue=0;


    if (CntOrd(OP_BUY,MagicNumber)>0) TradeLast=1;
    if (CntOrd(OP_SELL,MagicNumber)>0) TradeLast=-1;


    double MAC1, MAC2, MAC3;

    int limit=1;

    for (int shift=1; shift<=limit; shift++) {

    MAC1 = iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE _CLOSE,MODE_SIGNAL,shift+2);
    MAC2 = iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE _CLOSE,MODE_SIGNAL,shift+1);
    MAC3 = iMACD(NULL,0,MACD_Fast,MACD_Slow,MACD_Signal,PRICE _CLOSE,MODE_SIGNAL,shift);

    if (MAC1>MAC2 && MAC2<MAC3 && MAC1<-0.0004 && MAC2<-0.0004 && MAC3<-0.0004)
    {
    if (Reverse) SellValue=1; else BuyValue=1;
    break;
    }
    if (MAC1<MAC2 && MAC2>MAC3 && MAC1>0.0004 && MAC2>0.0004 && MAC3>0.0004)
    {
    if (Reverse) BuyValue=1; else SellValue=1;
    break;
    }
    }

  3. #13

    Default

    Hi guys, here by attach the two last days of trade, how you can see from the statment there are some negative trades (yellow) but if you check the time theyb are after 17.00, if you closed them before 16.00 they would have been positive!!!
    Anyway it's not so bad... There are many other modification to do but before that I will test the new file MACD Reverse Level EA v1.2.1.mq4

    Cheers
    MArio
    Attached Files Attached Files

  4. #14

    Default

    Looks pretty good Mario! :-)

    Could you please attach the ea and set file you are using to get those results? TIA!

  5. #15

    Default

    Quote Originally Posted by bnbb2004 View Post
    Looks pretty good Mario! :-)

    Could you please attach the ea and set file you are using to get those results? TIA!
    Hi, as I said I used different setting for every couple of currency so p.i today I used four with a different value of 0.0008; 0.0015; 0,1; 0.004
    the expert is the one I attached just need to calibrate the macd value...
    Attached Files Attached Files

  6. #16

    Default

    Quote Originally Posted by Straasha View Post
    I added the exit function : CloseAll_AT_Entime_GMT

    The results are very nice since 01/01/09

    HI, I did a lot of work on your modification, the experts works much better now BUT I found what it makes still non profitable (only 20 % per month), because the macd is a dynamic value need to be changed automatically!
    I did it a back testing manually before to buy or to sell and it worked beautifully, is it possible get the macd automatically from the indicator?
    Just to explain better the concept:
    7:00 macdsell 0.0001 macdbuy -0.0034 (you can input manually if you want) then when the values of the macd changed they have to be insert automatically instead of the old value and so on (it could be every 5 minutes p.i.)
    Cheers
    MArio

  7. #17
    Member
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    227

    Default

    Quote Originally Posted by mariothegreat View Post
    Hi, as I said I used different setting for every couple of currency so p.i today I used four with a different value of 0.0008; 0.0015; 0,1; 0.004
    the expert is the one I attached just need to calibrate the macd value...
    Hi Mario,

    what do you mean about "partial sale"?

    This EA is excellent, order open very good and then...? There are many hences on his way to the target.

    Here my suggestion: the EA open the trade with,for example, 0.3 Lot, after 15, 20 or 40 Pip ( adjustable ) he sell 0.2 Lot. The rest , 0.1 Lot, go away and exit like the rule. For this second "partial sale" we need a hidden SL and maybe TS, only for this!
    Lot for the rest-trade also adjustable.
    The reason for this strategy: the first x pips are mostly safe and the second part can not loose.( if our PC is online certainly )
    Is this possible to code?

    Best regards

    J_l
    Last edited by j_l; 03-20-2009 at 16:14.

  8. #18

    Default

    Quote Originally Posted by j_l View Post
    Hi Mario,

    what do you mean about "partial sale"?

    This EA is excellent, order open very good and then...? There are many hences on his way to the target.

    Here my suggestion: the EA open the trade with,for example, 0.3 Lot, after 15, 20 or 40 Pip ( adjustable ) he sell 0.2 Lot. The rest , 0.1 Lot, go away and exit like the rule. For this second "partial sale" we need a hidden SL and maybe TS, only for this!
    Lot for the rest-trade also adjustable.
    The reason for this strategy: the first x pips are mostly safe and the second part can not loose.( if our PC is online certainly )
    Is this possible to code?

    Best regards

    J_l


    Hmm I think there are some mistakes in the experts, first of all I tried the same settings but with a different number of lots (1 lot and 10 lots), the first has given a total amount (starting with 10,000 pounds) of 23,310, the second one should have been of 233,100 pounds, instead it lost most of the capital! See the two attachs.
    Another point is what it did in real trading this evening, the first bet was without stopp/loos then started normally and suddenly it opened dozens of bet closeng them in a couple of seconds (see the third attach).
    The ea is working need only to be adjusted a little bit...
    cheers
    mario
    Attached Images Attached Images MACD Reverse EA-17_09_2008_to-20_03_2009_b-gif MACD Reverse EA-17_09_2008_to-20_03_2009_bx10-gif MACD Reverse EA-20_03_2009-gif 
    Attached Files Attached Files

Similar Threads

  1. Reverse When In DD
    By Pheniox in forum Ideas for expert advisors
    Replies: 1
    Last Post: 12-27-2010, 19:34
  2. Sar reverse
    By Ricof1p in forum Ideas for expert advisors
    Replies: 1
    Last Post: 04-11-2010, 06:54
  3. MA Reverse
    By funyoo in forum Expert advisors backtesting
    Replies: 20
    Last Post: 01-25-2010, 04:54
  4. Reverse D RSI SYS
    By asafc12345 in forum Expert advisors backtesting
    Replies: 0
    Last Post: 11-01-2009, 18:29
  5. Reverse
    By srahmat in forum Ideas for expert advisors
    Replies: 1
    Last Post: 08-12-2009, 11:31

Tags for this Thread

100, average, eur, eur/usd, expert, experts, forex, indicator, level, macd, main, mq4, online, profit, profitable, profitable system, real, signal, signals, slippage, spread, stop, strategy, system, test, time, trading, trailing, trend, usd

Posting Permissions

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