← К каталогу
Исходный код · ID 3436

khelemenexpert v2 .mq4

Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Получить полный код

Поиск по коду файла

???//+------------------------------------------------------------------+

#property version   "2.0"
#property description "KhelemenExpert EA is a GRID type of EA."
#property strict

/*-- Configurable Variable --*/
double   Version                    = 2.0;  // Version
extern   string   MainProperties    = "===================================================================================";//MAIN
extern   string   Copyright         = "Copyright 2018, Khelemen"; // * Copyright
extern   string   LicenseCode       = "0"; // * License Code
extern   string   Prefix            = ""; // * Pair Symbol Prefix
extern   string   Postfix           = ""; // * Pair Symbol Postfix
extern   string   EAComment         = "KhelemenExpert V2.0"; // * Trade Comment
extern   string   OrderProperties   = "==================================================================================="; //ORDER SETTING
extern   int      TakeProfit        = 6;     // * Initial Take Profit (pips)
extern   int      PipStep           = 10;    // * Grid (pips)
extern   int      Slippage          = 30;    // * Slippage (points) 
extern   int      Level             = 1;     // * Risk Level (>1)
extern   int      MaxTrade          = 6;    // * Maximum Trade Open (one way)
extern   double   BrokerTolerant    = 0;    // * Normal Profit Tolerant (pips)
extern   int      RecoveryGrid      = 3;    // * Recovery Grid (pips) 
extern   double   ProfitRecoveryTolerant = 2; // * Profit Recovery Tolerant (pips)
extern   double   TargetEquity      = 20000; // * Target Withdraw (USD)
extern   string   OperationHour     = "===================================================================================";// OPERATION HOUR
extern   bool     SetTime           = False; // * Set Server Time
extern   int      Start_Time        = 1;          //* Start Time Daily
extern   int      Finish_Time       = 6;        //* End Time Daily
extern   string   Notes             = "===================================================================================";//NOTES
extern   string   A                 = "Always 0.01";//* Initial Lots Open
extern   string   B                 = "Equity Dependend";//* Risk Level Increment
extern   string   C                 = "USD 400 for 4 Maxs Trade per way";//* Money Management Ratio

/*-- Fixed Variable --*/
string   EAName               = "KhelementExpert-V"+DoubleToStr(Version)+"\nCoding by: Khelemen"; // EA Name to be display
double   SetPoint             = 0;    
int      Ticket               = 0;    // Order Checked
double   LevelBuy[13]         = {0.01,0.02,0.03,0.05,0.08,0.13,0.21,0.34,0.51,0.85,1.36,2.21,3.57}; //12 Level Buy 
double   LevelSell[13]        = {0.01,0.02,0.03,0.05,0.08,0.13,0.21,0.34,0.51,0.85,1.36,2.21,3.57}; //12 Level Sell 
double   LevelRecovery[13]    = {0.01,0.02,0.03,0.05,0.08,0.13,0.21,0.34,0.51,0.85,1.36,2.21,3.57}; //12 Level Recovery 
double   RecoveryMode         = False;
int      EAMagicNumber        = 0; // * Magic Number (Unique for Every Pair)
string   InitialLog           = "KEA V2";
color    BuyColorLine         = clrLightSkyBlue; // * Buy Color Line
color    SellColorLine        = clrLightCoral; // * Sell Color Line

#include <stdlib.mqh>
#include <stderror.mqh>
#include <WinUser32.mqh>

int init()
  {
      // код доступен только после оплаты
   }

int deinit()
  {

   return(0);
  }

int start()
  {
      // код доступен только после оплаты
   }

   if((MaxTrade > 13) && (MaxTrade < 1))
   {
      Alert("Maximum Trade per direction is ONLY 13 and Not LESS then 1.");
      return(0);
   }

   Comment(EAName+"\nServer Time: "+TimeToStr(TimeCurrent(), TIME_SECONDS)+"\nPairs : "+Symbol()+"\nEquity : "+AccountCurrency()+" "+DoubleToStr(AccountEquity(),2)+"\nBalance : "+AccountCurrency()+" "+DoubleToStr(AccountBalance(),2));             // Tampilkan Nama EA di layar

   /*--Main Operation--*/
   int      iCount         = 0;
   int      iTotalBuy      = 0;
   int      iTotalSell     = 0;
   int      BuyStop        = 0;
   int      SellStop       = 0;
   double   LastBuyPrice   = 0; 
   double   LastSellPrice  = 0; 
   double   LotsBuy        = 0;
   double   LotsSell       = 0;
   double   vTakeprofitBuy = 0;
   double   vTakeProfitSell= 0;
   double   spread         = 0;

   if ((!AllowTradesByTime()) && (SetTime==True)) return(0);

   for( iCount=0;iCount<OrdersTotal();iCount++)       
   {
    Ticket = OrderSelect(iCount, SELECT_BY_POS );
    if ( OrderSymbol() == Symbol() && OrderMagicNumber() == EAMagicNumber)
         {
           int Type = OrderType();

           if (Type == OP_BUY ) 
             {
              LastBuyPrice     = OrderOpenPrice(); 
              LotsBuy          = OrderLots();
              vTakeprofitBuy   = OrderTakeProfit(); 
              iTotalBuy++; 
             }

           if (Type == OP_SELL )      
             {
              LastSellPrice     = OrderOpenPrice(); 
              LotsSell          = OrderLots();
              vTakeProfitSell   = OrderTakeProfit();
              iTotalSell++;              
             }
         }
   }

    RefreshRates();
    spread         = NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD),Digits);
    if ((iTotalBuy==0) && (iTotalSell == 0)) {RecoveryMode = False;}

    if ((iTotalBuy==0) && (RecoveryMode==False)) 
    {
        Ticket = OrderSend(Symbol(), OP_BUY, normalizelot(Level*LevelBuy[0]),  Ask, Slippage, 0, NormalizeDouble(Ask+((TakeProfit-BrokerTolerant)*SetPoint),Digits), EAComment, EAMagicNumber,0,BuyColorLine);
        ErrorHandling(Ticket,"BUY","Level 1",spread);         
    }     
       else
    {
         if ((!RecoveryMode) && (iTotalBuy <= MaxTrade)) 
         {
            GoMartingale("LONG",iTotalBuy,LastBuyPrice);
            if (iTotalBuy > 1)  {ModifyTakeProfit("LONG");}

         } else 
         {
            RecoveryMode = True;
            GoRecovery("LONG",LastBuyPrice,iTotalBuy);
     

Показано первые 50% кода (символов: 10722)

Что вы получите после оплаты

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
1 072₽