Jump to content

bbrain

⭐ V.I.P.
  • Posts

    223
  • Joined

  • Last visited

Posts posted by bbrain

  1. Re: Swissy Accu-Scalper Robot EA

     

    Hi,

     

    Few functions from the dll:

     

    bool IsTradeTime(int a1, int a2, int a3, int a4, int a5)
    {
     return (a4 <= 31 - a5);
    }
    
    bool s1_Buy(double a1, double a2, double a3, double a4, double a5, double a6, double a7, double a8, int a9, int a10)
    {
     if ( a2 < 0 && (!a9 || a5 - a1 >= a8) )
     {
       if ( a3 < a6 )
         return (1);
       if ( a10 && a7 > a4 && a3 < 50 )
         return (1);
     }
     return (0);
    }
    
    bool s1_Sell(double a1, double a2, double a3, double a4, double a5, double a6, double a7, double a8, int a9, int a10)
    {
     if ( a2 > 0 && (!a9 || a1 - a5 >= a8) )
     {
       if ( a3 > a6 )
         return (1);
       if ( a10 && a7 < a4 && a3 > 50 )
         return (1);
     }
     return (0);
    }
    
    bool s2_Buy(double a1, double a2, double a3, double a4, double a5, double a6, int a7, int a8)
    {
     if ( a1 > a5 )
       return (0);
     if ( !a7 || a3 < 0 )
     {
       if ( (!a8 || a4 >= 0) && a1 - a2 < a6 - a5 )
         return 1;
       return (0);
     }
     return (0);
    }
    
    bool s2_Sell(double a1, double a2, double a3, double a4, double a5, double a6, int a7, int a8)
    {
     if ( a2 < a6 )
       return (0);
     if ( !a7 || a3 > 0 )
     {
       if ( (!a8 || a4 <= 0) && a6 - a5 > a1 - a2 )
         return (1);
       return (0);
     }
     return (0);
    }
    

  2. Re: Building your own EA G/08.

     

    Hi,

     

    Download MT5! You can debug the code in runtime.

     

    Regards, bbr.

     

     

    OK.. here is some code I wrote.. Not working as it is supposed to, so if anyone knows why.. I would be pleased to hear the solution.

     

    This is a bearish engulfing pattern on a timer.. The timer works great and I was really happy with it..

     

    What does not work great is the code that is supposed to kick in at a market high..

     

    It kicks in anytime it feels fit and not necessarily at a market high.. :huh:

     

    In addition.. it sees each Monday zero bar as a bear bar when it may not be.. so I am stumped.

     

     

         extern int   EnglufSleepHours               =39;
         extern double EngulfingBarsize              =40; 
    
         bool   MarketHigh =        (lastOpen >= Highest5DayOpn);
         bool   Bar4Bear =          (iOpen(NULL,PERIOD_H4,1) >= iClose(NULL,PERIOD_H4,1));
         bool   Bar4Bull =          (iClose(NULL,PERIOD_H4,1)>= iOpen(NULL,PERIOD_H4,1));
         double Delta4HL_0 =        MathAbs(iClose(NULL,PERIOD_H4,1)-iOpen(NULL,PERIOD_H4,1));
         double Delta4HL_1 =        MathAbs(iOpen(NULL,PERIOD_H4,2)-iClose(NULL,PERIOD_H4,2));
         double Dif4ClsOpn =        ((iClose(NULL,PERIOD_H4,2)-0.0002)-iOpen(NULL,PERIOD_H4,1));
    
    
    
       if (Bar4Bear && iHigh(NULL,PERIOD_H4,1) > iHigh(NULL,PERIOD_H4,2)) int xz=EngulfingBarsize; 
         {
           static int EngulfTime; static bool Engulfed=false;
           if  ((MarketHigh) &&((Delta4HL_0 + (iHigh(NULL,PERIOD_H4,1)-iOpen(NULL,PERIOD_H4,1))) > 
           xz*Point) && (Delta4HL_0 >= Delta4HL_1) && (Dif4ClsOpn <= 0.0004)&& !Engulfed){             
           EngulfTime = iTime(NULL,PERIOD_H4,0); Engulfed = true;
           if (Engulfed) Print("Buy is Sleeping Util : " + TimeToStr(EngulfTime,TIME_DATE|TIME_MINUTES)); }   //Note the string needs fixing 
           if(((TimeCurrent()-EngulfTime)/60/60)<EnglufSleepHours && Engulfed) UseBuy=0; UseSell=1;
           if(((TimeCurrent()-EngulfTime)/60/60)>=EnglufSleepHours)Engulfed=false;
          }  
          
       if (!Engulfed) 
         {
          UseBuy=1; UseSell=0;
         }
    
    

     

    Anyway.. if anyone feels like using it.. you will need to solve that problem and I would appreciate an update if you get it going. Else when I find out what I have done wrong.. I will post the solution.

  3. Re: euronis_v4160

     

    sorry bbrain...

    but the EA isn't educated.

     

    it's necesary change the key file.

     

    change the funtion 60 it's NOT enough:

     

    bool li_ret_0 = FALSE;

    // if (gi_1316 != g_str2int_1440) li_ret_0 = TRUE; //bbr

    // if (gi_1320 != g_str2int_1444) li_ret_0 = TRUE; //bbr

    // if (gi_1324 != g_str2int_1448) li_ret_0 = TRUE; //bbr

    return (li_ret_0);

     

    more things need to change.

    Regards

     

     

    I will check code again.

×
×
  • Create New...