Download MetaTrader 5

Experts: EA_PSar_002B_v1

To add comments, please log in or register
Register as a seller and start offering your signals!
MetaQuotes Software Corp.
Moderator
181268
MetaQuotes Software Corp. 2010.09.22 13:27 

EA_PSar_002B_v1:

EA designed on the idea of the indicator Nik_PSAR_2B (http://codebase.mql4.com/6934). EA works on the Symbol = "EURUSD" and Period = M1.

Author: Leonid Basis

MQL4 Comments
16319
MQL4 Comments 2010.09.24 09:47  

Nice work basis...

I built myself one on Nik_PSAR_2b as well using pending orders on EURUSD H1. I dubbed it "Craptacular" - my code is crappy but it had surprising results...

I really like the concept of that indicator...

Great work on your interpretation.

Max.

JoeSlomo7777
20
JoeSlomo7777 2010.09.24 11:07  

Hi Max, this looks great, could you post your EA here perhaps?

Thanks,

Andre

whroeder1
14519
whroeder1 2010.09.24 15:14  
  1. Don't hard code numbers
    // a = NormalizeDouble((PercentMM * AccountFreeMargin() / 100000), 1); // Valid IFF minlot and lotstep == 0.1
    //      if(a > 49.9) return(49.9);
    //      else if(a < 0.1)
    a = (PercentMM * AccountFreeMargin() / 100000),
    double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP),   //IBFX= 0.01
           maxLot  = MarketInfo(Symbol(), MODE_MAXLOT ),   //IBFX=50.00
           minLot  = MarketInfo(Symbol(), MODE_MINLOT );   //IBFX= 0.01
                                                           //Was IBFX= 0.10
    a =  MathFloor(a/LotStep)*LotStep;
           if (a > maxLot) return(maxLot);
           if (a < minLot)
    ...
    

  2. The EA should adjust SL/TP/ and slippage for 5 digit brokers
    //++++ These are adjusted for 5 digit brokers.
    double  pips2points,    // slippage  3 pips    3=points    30=points
            pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int init(){
        if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                    pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
        } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
        // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
    

Leonid Basis
21317
Leonid Basis 2010.09.24 15:44  
WHRoeder:
  1. Don't hard code numbers
    // a = NormalizeDouble((PercentMM * AccountFreeMargin() / 100000), 1); // Valid IFF minlot and lotstep == 0.1
    //      if(a > 49.9) return(49.9);
    //      else if(a < 0.1)
    a = (PercentMM * AccountFreeMargin() / 100000),
    double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP),   //IBFX= 0.01
           maxLot  = MarketInfo(Symbol(), MODE_MAXLOT ),   //IBFX=50.00
           minLot  = MarketInfo(Symbol(), MODE_MINLOT );   //IBFX= 0.01
                                                           //Was IBFX= 0.10
    a =  MathFloor(a/LotStep)*LotStep;
           if (a > maxLot) return(maxLot);
           if (a < minLot)
    ...
    

  2. The EA should adjust SL/TP/ and slippage for 5 digit brokers
    //++++ These are adjusted for 5 digit brokers.
    double  pips2points,    // slippage  3 pips    3=points    30=points
            pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int init(){
        if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                    pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
        } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
        // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
    


Thank you.
Leonid Basis
21317
Leonid Basis 2010.09.24 15:45  
maxfor:

Nice work basis...

I built myself one on Nik_PSAR_2b as well using pending orders on EURUSD H1. I dubbed it "Craptacular" - my code is crappy but it had surprising results...

I really like the concept of that indicator...

Great work on your interpretation.

Max.



Good work!
ChuQ Dennis
17
ChuQ Dennis 2010.10.06 13:47  
Please, I will like to include a money management technique to my EA. The idea is to let only a fraction of your total margin be in use at any instant. For example, you can use only 50% of account; with 50% margin usage the EA risk only 50% of account in worst scenario. Any help as to how to generate this code and include it in my EA at http://www.mql4.com/users/brayt? You can find details of where this idea is applied at http://www.fxpromaker.com/advanced50.html. ANY HELP PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To add comments, please log in or register