Download MetaTrader 5

Experts: Expert Advisor 3 Level ZZ Semafor

To add comments, please log in or register
Documentation is available in CHM and PDF. Download it in any convenient form!
MetaQuotes Software Corp.
Moderator
181050
MetaQuotes Software Corp. 2012.01.05 07:14 

Expert Advisor 3 Level ZZ Semafor:

This Expert Advisor is based on 3_Level_ZZ_Semafor indicators.

Author: ultimatefx

Tjipke de Vries
6314
Tjipke de Vries 2012.01.06 00:14  
   if(lot<10) lot=10;

Is this real ???? not minimum lotsize ....?

Make CheckForClose() also counting down

Why
res1,res2,res3,res4 and OP_SELL <= 3 and OP_BUY <= 3 if you only checkfor open

if(CalculateCurrentOrders(Symbol())==0)

for 5 digit brokers 3 as slippage is too low

ultimatefx
34
ultimatefx 2012.01.10 11:38  
deVries:
   if(lot<10) lot=10;

Is this real ???? not minimum lotsize ....?

Make CheckForClose() also counting down

Why
res1,res2,res3,res4 and OP_SELL <= 3 and OP_BUY <= 3 if you only checkfor open

if(CalculateCurrentOrders(Symbol())==0)

for 5 digit brokers 3 as slippage is too low


Thanks so much for ur comment..i was improve my EA and this is The revision of my EA, please check it out !!!

/*
   Ultimate Explorer Corp
   E-mail : ultimateexplorer2011@gmail.com
*/
#property copyright "danusaputra@2012 Ultimate Explorer Corp "
#property link      "http://www.facebook.com"
//#include <stdlib.mqh>
#import "stdlib.ex4"
   string ErrorDescription(int a0);
#import
extern string     EAName                     = "Robot Danu Saputra_Ultimate Explorer Investment";
extern double     Period1                    =5; 
extern double     Period2                    =13; 
extern double     Period3                    =34;
extern int        Mode                       =0; 
extern bool       IsMicroAccount             = TRUE;
extern bool       CompletedBars              = FALSE;
extern bool       TradeOrAlert               = TRUE;
extern bool       SendMailMode               = TRUE;
extern bool       PlaySounds                 = TRUE;
extern string     MySound                    = "alert.wav";
extern bool       FiveDigits                 = TRUE;
int               gi_116                     = 1;
extern bool       UseTradingTime             = FALSE;
extern int        TradingTimeStart           = 9;
extern int        TradingTimeEnd             = 16;
extern bool       ClosePositionsNonTH        = FALSE;
extern bool       OrderIncludeTPSL           = TRUE;
extern int        MaxNumberofPositions       = 1;
extern int        MaxOrderRetry              = 100;
int               gi_148                     = 16711680;
int               gi_152                     =255;
bool              gi_156                     = FALSE;
extern bool       UseMaximumPercentageatRisk = false;
extern double     MaximumPercentageatRisk    = 10.0;
extern bool       UseRiskRatio               = FALSE;
extern int        RiskRatio                  = 3;
extern bool       UseLotManagement           = false;
extern int        LotManagementType          = 1;
extern double     ReductionFactor            = 5.0;
extern bool       UseMartingale              = true;
extern double     MartingaleMultiplier       = 2.0;
double            gd_208                     = 100.8;
extern bool       afterLoss                  = TRUE;
extern bool       afterWin                   = true;
int               g_datetime_224             = 0;
extern int        Slippage                   = 3;
extern double     S_Symbol_LS_0              = 1.0; // Lot for Sell
extern double     S_Symbol_TP_0              = 0.0; // Take Profit for Sell
extern double     S_Symbol_SL_0              = 0.0; // Stop Loss for Sell
extern double     S_Symbol_TS_0              = 0.0; // Trailing Stop for Sell
extern double     B_Symbol_LS_0              = 1.0; // Lot for Buy
extern double     B_Symbol_TP_0              = 0.0; // Take Profit for Buy
extern double     B_Symbol_SL_0              = 0.0; // Stop Loss for Buy
extern double     B_Symbol_TS_0              = 0.0; // Trailing Stop for Sell
extern int        MagicNumberLong            = 6658641;
extern int        MagicNumberShort           = 4167090;
string            gs_go_long__304            = "Go long ";
string            gs_312                     = "Go short ";
extern bool       ShowWarnings               = TRUE;
int               g_bars_324                 = 0;
string            g_str_concat_328           = "";
string            g_str_concat_336           = "EA: ";
extern bool       CheckTSEveryTick           = FALSE;
int               g_datetime_348             = 0;
extern bool       UseTimeBasedTS             = FALSE;
extern int        TimeBasedTS                = 30;
extern bool       Hedge                      = FALSE;
int init() {
   g_datetime_224 = TimeCurrent();
   gs_go_long__304 = "Go long " + MagicNumberLong;
   gs_312 = "Go short " + MagicNumberShort;
   if (FiveDigits) gi_116 = 10;
   Slippage *= gi_116;
   if (Digits == 5 || Digits == 3 && (!FiveDigits)) {
      Print("M-", Symbol(), " You selected FiveDigits=False but your graph seems to have 5 digits (or 3 for JPY pairs). Please review your digits definition.");
      MessageBox("M-" + Symbol() + " You selected FiveDigits=False but your graph seems to have 5 digits (or 3 for JPY pairs). Please review your digits definitions.",
         "Digits setup may be wrong");
   }
   if (Digits == 4 || Digits == 2 && FiveDigits) {
      Print("M-", Symbol(), " You selected FiveDigits=True but your graph seems to have 4 digits (or 2 for JPY pairs). Please review your digits definition.");
      MessageBox("M-" + Symbol() + " You selected FiveDigits=True but your graph seems to have 4 digits (or 2 for JPY pairs). Please review your digits definitions.", "Digits setup may be wrong");
   }
   Print(" This EA created by Danu Saputra ");
   Print(" This EA starts running at: Server Time=", TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS), " Terminal Time=", TimeToStr(TimeLocal(), TIME_DATE|TIME_SECONDS));
   if (IsDemo()) Print(" This EA Running in a DEMO account ");
   else Print(" This EA Running in a REAL account ");
   if (IsTesting()) Print(" This EA Running in TESTING MODE ");
   if (Hedge) {
      Print("You are hedging. You need to use the Close icons in your trading diagram to close postitions.");
      if (ShowWarnings) MessageBox("You are hedging. You need to use the Close icons in your trading diagram to close postitions.", "Danu Saputra Warning: Close existing orders");
   }
   g_datetime_348 = TimeCurrent();
   if (CheckTSEveryTick) Print(" This EA checks trailing stops every tick regardless of Execution Mode (Bars or ticks).");
   Print("Account Equity=", AccountEquity(), ". Account Balance=", AccountBalance(), ". Account Free Margin = ", AccountFreeMargin(), ". Account Leverage=", AccountLeverage());
   if (OrdersTotal() > 0) {
      Print("There are existing positions that could affect the logic of this EA. We strongly advise you to close all pending and open positions/orders before executing this EA.");
      if (ShowWarnings) {
         MessageBox("There are existing positions that could affect the logic of this EA. We strongly advise you to close all pending and open positions/orders before executing this EA.",
            "Danu Saputra Warning: Close existing orders");
      }
   }
   if (Bars < 100) {
      Print("EA CAN NOT TRADE *** Not enough historical information!");
      MessageBox("*** CAN NOT TRADE *** Not enough historical information!", "Danu Saputra Warning");
   }
   if (IsTradeAllowed() == FALSE) {
      Print(" EA CAN NOT TRADE *** Trading is not allowed! Please confirm that the checkbox -Allow Live Trading option- is checked and that you are able to connect to the server.");
      if (ShowWarnings) {
         MessageBox("*** CAN NOT TRADE *** Trading is not allowed! Please confirm that the checkbox -Allow Live Trading option- is checked and that you are able to connect to the server.",
            "Danu Saputra Warning");
      }
   }
   if (UseLotManagement && UseMartingale) {
      UseLotManagement = FALSE;
      Print(" This EA cannot use Martingale and Lot Management at the same time. The ea will use martingale.");
      if (ShowWarnings) MessageBox("You cannot use Martingale and Lot Management at the same time. The ea will use martingale.", "Danu Saputra Warning: Money Management");
   }
   Print("EA-Lot Information: Symbol=", Symbol(), ". MIN LOT ALLOWED=", MarketInfo(Symbol(), MODE_MINLOT), ". MAX LOT ALLOWED=", MarketInfo(Symbol(), MODE_MAXLOT), ". LOT SIZE IN BASE CURRENCY=",
      MarketInfo(Symbol(), MODE_LOTSIZE));
   Print("EA-Lot Information: Buying 1 lot in your Account is equivalent to buying ", MarketInfo(Symbol(), MODE_LOTSIZE), " of currency.");
   Print("EA-Lot Information: Buying the minimum lot size of ", MarketInfo(Symbol(), MODE_MINLOT), " is equivalent to buying ", MarketInfo(Symbol(), MODE_LOTSIZE) * MarketInfo(Symbol(),
      MODE_MINLOT), " of currency.");
   Print("EA-Min Stops/Limit Level = ", MarketInfo(Symbol(), MODE_STOPLEVEL), " pips.");
   RefreshRates();
   return (0);
}
int deinit() {
   Print(" Danu Saputra EA is stopping ! Done!");
   Comment("");
   return (0);
}
int start() {
   if (StrToTime("2012.01.13") + 259200 < TimeCurrent()) {
      Print("Your Trial license enought already hehehe :)just kidding. Please contact us or buy a license from ultimateexplorer2011@gmail.com (Just Kidding hehehe)");
      Comment("Your Trial license enought already hehehe :)just kidding. Please contact us or buy a license from ultimateexplorer2011@gmail.com (Just Kidding hehehe)");
      Alert("Your Trial license enought already hehehe :)just kidding. Please contact us or buy a license from ultimateexplorer2011@gmail.com (Just Kidding hehehe)");
      return;
   }
   gi_156 = FALSE;
   string str_concat_0 = "Robot Ini Hak Cipta Danu Saputra - Ultimate Explorer Corp";
   if (TradeOrAlert) str_concat_0 = StringConcatenate(str_concat_0, " Trading Mode -");
   else str_concat_0 = StringConcatenate(str_concat_0, " Alarm Mode -");
   str_concat_0 = StringConcatenate(str_concat_0, 
   "\nServer Time=", TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS));
   Comment(str_concat_0);
   if (UseTradingTime) {
      if (!(Hour() >= TradingTimeStart && Hour() <= TradingTimeEnd)) {
         str_concat_0 = StringConcatenate(str_concat_0, " General Settings: Server Time=", Hour(), "h:", Minute(), "m. | Current server time is NOT between trading time hours. | Trading Time is from ",
            TradingTimeStart, " to ", TradingTimeEnd, " hours");
         Comment(str_concat_0);
         if (!(ClosePositionsNonTH && TradeOrAlert)) return (0);
         f0_1(OP_BUY, MagicNumberLong);
         f0_1(OP_SELL, MagicNumberShort);
         f0_1(OP_BUY, MagicNumberLong);
         f0_1(OP_SELL, MagicNumberShort);
         return (0);
      }
      str_concat_0 = StringConcatenate(str_concat_0, " General Settings: Server Time=", Hour(), "h:", Minute(), "m. | Current server time is between trading time hours. | Trading Time is from ",
         TradingTimeStart, " to ", TradingTimeEnd, " hours");
      Comment(str_concat_0);
   }
   if (UseTimeBasedTS && TradeOrAlert) {
      if (TimeCurrent() - g_datetime_348 > 60 * TimeBasedTS) {
         g_datetime_348 = TimeCurrent();
         f0_2(Symbol(), 1, MagicNumberShort, S_Symbol_TS_0);
         f0_2(Symbol(), 0, MagicNumberLong, B_Symbol_TS_0);
      }
   }
   if (SendMailMode) {
      g_str_concat_336 = "EA: ";
      g_str_concat_336 = StringConcatenate(g_str_concat_336, EAName, " ");
      g_str_concat_328 = "email generated by Danu Saputra_Ultimate Explorer \n";
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Server Time=", TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS), ". Terminal Time=", TimeToStr(TimeLocal(), TIME_DATE|TIME_SECONDS), 
      "\n");
   }
   if (!IsConnected()) {
      Print("EA-URGENT ACTION REQUIRED : There is no connection to the server!");
      if (ShowWarnings) Alert("URGENT ACTION REQUIRED : There is no connection to the server!");
      if (!(ShowWarnings && SendMailMode)) return (0);
      g_str_concat_336 = StringConcatenate(g_str_concat_336, "URGENT ACTION REQUIRED : There is no connection to the server");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "URGENT ACTION REQUIRED : There is no connection to the server. Please check your MT4 terminal.\n");
      SendMail(g_str_concat_336, g_str_concat_328);
      return (0);
   }
   if (IsStopped()) {
      Print("EA-ERROR : EA was commanded to stop its operation!");
      if (ShowWarnings) Alert("ERROR : EA was commanded to stop its operation!");
      if (!(ShowWarnings && SendMailMode)) return (0);
      g_str_concat_336 = StringConcatenate(g_str_concat_336, "EA was commanded to stop its operation");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "EA was commanded to stop its operation!\n");
      SendMail(g_str_concat_336, g_str_concat_328);
      return (0);
   }
   if ((!IsTradeAllowed()) && TradeOrAlert) {
      Print("EA-ERROR : Trading is not allowed!");
      if (ShowWarnings) Alert("ERROR : Trading is not allowed!");
      if (!(ShowWarnings && SendMailMode)) return (0);
      g_str_concat_336 = StringConcatenate(g_str_concat_336, "Trading is not allowed");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Trading is not allowed at this moment. Please take action if needed\n");
      SendMail(g_str_concat_336, g_str_concat_328);
      return (0);
   }
   if (g_bars_324 == Bars && CompletedBars) {
      if (!(CheckTSEveryTick && TradeOrAlert)) return (0);
      f0_2(Symbol(), 1, MagicNumberShort, S_Symbol_TS_0);
      f0_2(Symbol(), 0, MagicNumberLong, B_Symbol_TS_0);
      return (0);
   }
   if (TradeOrAlert) {
      if (iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3", "8,5", "21,12", 140, 141, 142, 5, Mode) > iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3",
         "8,5", "21,12", 140, 141, 142, 4, Mode)) f0_9(Symbol(), S_Symbol_LS_0, S_Symbol_TP_0, S_Symbol_SL_0, S_Symbol_TS_0, "if ( ( iCustom(Symbol(),0,3_Level_ZZ_Semafor,5,13,75,1,3,8,5,21,12,140,141,142,5,1)  >  iCustom(S...");
      
      if (iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period2, "1,3", "8,5", "21,12", 140, 141, 142, 5, Mode) < iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3",
         "8,5", "21,12", 140, 141, 142, 4, Mode)) f0_12(Symbol(), B_Symbol_LS_0, B_Symbol_TP_0, B_Symbol_SL_0, B_Symbol_TS_0, "if ( ( iCustom(Symbol(),0,3_Level_ZZ_Semafor,5,13,75,1,3,8,5,21,12,140,141,142,5,1)  <  iCustom(S...");
      
      f0_2(Symbol(), 1, MagicNumberShort, S_Symbol_TS_0);
      f0_2(Symbol(), 0, MagicNumberLong, B_Symbol_TS_0);
   } else {
      if (iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3", "8,5", "21,12", 140, 141, 142, 5, Mode) > iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3",
         "8,5", "21,12", 140, 141, 142, 4, Mode)) f0_4("if ( ( iCustom(Symbol(),0, 3_Level_ZZ_Semafor ,5,13,75, 1,3 , 8,5 , 21,12 ,140,141,142,5,1)  >  iCu...", "SELL(Symbol(),1.0,10,0,5)", Symbol());
      if (iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3", "8,5", "21,12", 140, 141, 142, 5, Mode) < iCustom(Symbol(), 0, "3_Level_ZZ_Semafor", Period1, Period2, Period3, "1,3",
         "8,5", "21,12", 140, 141, 142, 4, Mode)) f0_4("if ( ( iCustom(Symbol(),0, 3_Level_ZZ_Semafor ,5,13,75, 1,3 , 8,5 , 21,12 ,140,141,142,5,1)  <  iCu...", "BUY(Symbol(),1.0,10,0,5)", Symbol());
   }
   g_bars_324 = Bars;
   return (0);
}
int f0_4(string as_0, string as_8, string a_symbol_16) {
   double ask_32;
   double bid_24;
   if (SendMailMode) {
      bid_24 = MarketInfo(a_symbol_16, MODE_BID);
      ask_32 = MarketInfo(a_symbol_16, MODE_ASK);
      g_str_concat_336 = "EA Alert: ";
      g_str_concat_336 = StringConcatenate(g_str_concat_336, EAName, ". ", as_8);
      g_str_concat_328 = "email generated by Danu Saputra_Ultimate Explorer \n";
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Server Time=", TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS), ". Terminal Time=", TimeToStr(TimeLocal(), TIME_DATE|TIME_SECONDS), 
      "\n");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Alert: ", as_8, 
         "\nForex Signal: ", as_0, 
      "\n");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Price on : ", a_symbol_16, " BID=", bid_24, " ASK=", ask_32, 
      "\n");
      g_str_concat_328 = StringConcatenate(g_str_concat_328, "Price on current chart: ", Symbol(), " BID=", MarketInfo(Symbol(), MODE_BID), " ASK=", MarketInfo(Symbol(), MODE_ASK), 
      "\n");
      SendMail(g_str_concat_336, g_str_concat_328);
   }
   Print("M-Alert:", as_8, " Forex Signal: ", as_0);
   Alert("M-Alert:", as_8, " Forex Signal: ", as_0);
   if (PlaySounds) PlaySound(MySound);
   return (0);
}
int f0_12(string as_0, double ad_8, double ad_16, double ad_24, double ad_unused_32, string as_40) {
   if (!Hedge) f0_11(as_0, OP_SELL, MagicNumberShort);
   if (OrderIncludeTPSL) {
      if (f0_10(OP_BUY, as_0, f0_7(as_0, ad_8), ad_24, ad_16, gs_go_long__304, MagicNumberLong, gi_148, as_40) > 0) {
      }
   } else {
      if (f0_8(0, as_0, f0_7(as_0, ad_8), ad_24, ad_16, gs_go_long__304, MagicNumberLong, gi_148, as_40) > 0) {
      }
   }
   return (0);
}
int f0_9(string as_0, double ad_8, double ad_16, double ad_24, double ad_unused_32, string as_40) {
   if (!Hedge) f0_11(as_0, OP_BUY, MagicNumberLong);
   if (OrderIncludeTPSL) {
      if (f0_10(OP_SELL, as_0, f0_7(as_0, ad_8), ad_24, ad_16, gs_312, MagicNumberShort, gi_152, as_40) > 0) {
      }
   } else {
      if (f0_8(1, as_0, f0_7(as_0, ad_8), ad_24, ad_16, gs_312, MagicNumberShort, gi_152, as_40) > 0) {
      }
   }
   return (0);
}
int f0_13(string as_0, double ad_8) {
   if (AccountFreeMarginCheck(as_0, OP_BUY, ad_8) < 10.0 || AccountFreeMarginCheck(as_0, OP_SELL, ad_8) < 10.0 || GetLastError() == 134/* NOT_ENOUGH_MONEY */) {
      Print("EA-NOT ENOUGH MONEY TO TRADE. Free margin is insufficient to trade a lot size of ", ad_8, ". Current Free Margin=", AccountFreeMargin());
      Alert("EA-NOT ENOUGH MONEY TO TRADE. Free margin is insufficient to trade a lot size of ", ad_8, ". Current Free Margin=", AccountFreeMargin());
      return (0);
   }
   return (1);
}
int f0_8(int ai_0, string a_symbol_4, double ad_12, double a_price_20, double a_price_28, string as_36, int ai_44, color a_color_48, string as_52) {
   double point_68;
   double digits_76;
   double ld_84;
   bool li_92;
   int error_60 = 0;
   Print("EA-Executing order in Two Steps. Step 1 - Sending order without TP/SL.");
   int ticket_64 = f0_10(ai_0, a_symbol_4, ad_12, 0, 0, as_36, ai_44, a_color_48, as_52);
   if (ticket_64 > 0 && a_price_20 != 0.0 || a_price_28 != 0.0) {
      Print("EA-Executing order in Two Steps. Step 2 - Adding TP/SL.");
      if (OrderSelect(ticket_64, SELECT_BY_TICKET)) {
         RefreshRates();
         digits_76 = MarketInfo(a_symbol_4, MODE_DIGITS);
         point_68 = MarketInfo(a_symbol_4, MODE_POINT);
         a_price_20 *= gi_116;
         a_price_28 *= gi_116;
         if (UseRiskRatio) {
            a_price_20 = NormalizeDouble(a_price_28 / RiskRatio, digits_76);
            Print("EA-Stop loss adjusted according to risk ratio, equation TakeProfit/StopLoss=", RiskRatio, ". SL=Price +/- ", a_price_20 * point_68, ".");
         }
         switch (ai_0) {
         case 0:
            li_92 = TRUE;
            break;
         case 1:
            li_92 = FALSE;
            break;
         default:
            Print("EA-ERROR : Wrong order type. Can not add SL/TP ", ai_0);
            return (-1);
         }
         if (li_92) {
            ld_84 = NormalizeDouble(MarketInfo(a_symbol_4, MODE_ASK), digits_76);
            if (a_price_20 > 0.0) {
               a_price_20 = NormalizeDouble(ld_84 - a_price_20 * point_68, digits_76);
               a_price_20 = f0_6(a_symbol_4, ld_84, a_price_20);
            }
            if (a_price_28 > 0.0) {
               a_price_28 = NormalizeDouble(ld_84 + a_price_28 * point_68, digits_76);
               a_price_28 = f0_0(a_symbol_4, ld_84, a_price_28);
            }
         } else {
            ld_84 = NormalizeDouble(MarketInfo(a_symbol_4, MODE_BID), digits_76);
            if (a_price_20 > 0.0) {
               a_price_20 = NormalizeDouble(ld_84 + a_price_20 * point_68, digits_76);
               a_price_20 = f0_6(a_symbol_4, ld_84, a_price_20);
            }
            if (a_price_28 > 0.0) {
               a_price_28 = NormalizeDouble(ld_84 - a_price_28 * point_68, digits_76);
               a_price_28 = f0_0(a_symbol_4, ld_84, a_price_28);
            }
         }
         if (OrderModify(ticket_64, OrderOpenPrice(), a_price_20, a_price_28, 0, a_color_48)) Print("M-Step 2 - TP/SL added. SL=", a_price_20, " TP=", a_price_28);
         else {
            error_60 = GetLastError();
            Print("EA-Step 2 failed. Could not add SL/TP to order. Error:", error_60, " ", ErrorDescription(error_60));
         }
      } else {
         error_60 = GetLastError();
         Print("EA-Step 2 failed. Could not select order. Error:", error_60, " ", ErrorDescription(error_60));
      }
   }
   return (0);
}
int f0_10(int a_cmd_0, string a_symbol_4, double a_minlot_12, double a_price_20, double a_price_28, string a_comment_36, int a_magic_44, color a_color_48, string as_52) {
   double price_72;
   int ticket_88;
   bool li_92;
   int error_96;
   int li_100 = 1;
   a_price_20 *= gi_116;
   a_price_28 *= gi_116;
   switch (a_cmd_0) {
   case OP_BUY:
      li_92 = TRUE;
      break;
   case OP_SELL:
      li_92 = FALSE;
      break;
   default:
      Print("EA-ERROR : Wrong order type ", a_cmd_0);
      return (-1);
   }
   if (f0_3(a_symbol_4, a_cmd_0, a_magic_44) >= MaxNumberofPositions) {
      Print("EA-Warning : Can not execute new ", f0_5(a_cmd_0), " order for Symbol ", a_symbol_4, ". Maximum number of ", MaxNumberofPositions, " open positions reached.");
      return (0);
   }
   if (!f0_13(a_symbol_4, a_minlot_12)) return (-1);
   int digits_60 = MarketInfo(a_symbol_4, MODE_DIGITS);
   double point_64 = MarketInfo(a_symbol_4, MODE_POINT);
   if (UseRiskRatio) {
      a_price_20 = NormalizeDouble(a_price_28 / RiskRatio, digits_60);
      Print("EA-Stop loss adjusted according to risk ratio, equation TakeProfit/StopLoss=", RiskRatio, ". SL=Price +/- ", a_price_20 * point_64, ".");
   }
   int li_108 = 1;
   if (IsMicroAccount) li_108 = 2;
   double lots_112 = a_minlot_12;
   if (NormalizeDouble(AccountFreeMargin() * (MaximumPercentageatRisk / 100.0) / 1000.0, li_108) < a_minlot_12 && UseMaximumPercentageatRisk) {
      a_minlot_12 = NormalizeDouble(AccountFreeMargin() * (MaximumPercentageatRisk / 100.0) / 1000.0, li_108);
      if (a_minlot_12 < MarketInfo(a_symbol_4, MODE_MINLOT)) {
         a_minlot_12 = MarketInfo(a_symbol_4, MODE_MINLOT);
         Print("EA-Lot adjusted from ", lots_112, " to minimum size allowed by the server of ", a_minlot_12, " but it DOES NOT comply with Maximum Risk condition. User interaction is required!");
      } else Print("EA-Lot adjusted from ", lots_112, " to ", a_minlot_12, " to comply with Maximum Risk condition. Each trade can risk only ", MaximumPercentageatRisk, "% of free margin.");
   }
   while (li_100 > 0) {
      RefreshRates();
      if (li_92) {
         price_72 = NormalizeDouble(MarketInfo(a_symbol_4, MODE_ASK), digits_60);
         if (a_price_20 > 0.0) {
            a_price_20 = NormalizeDouble(price_72 - a_price_20 * point_64, digits_60);
            a_price_20 = f0_6(a_symbol_4, price_72, a_price_20);
         }
         if (a_price_28 > 0.0) {
            a_price_28 = NormalizeDouble(price_72 + a_price_28 * point_64, digits_60);
            a_price_28 = f0_0(a_symbol_4, price_72, a_price_28);
         }
         Print("EA-Preparing Buy 
Tjipke de Vries
6314
Tjipke de Vries 2012.01.10 12:29  

Thanks so much for ur comment..i was improve my EA and this is The revision of my EA, please check it out !!!

Code in comments given is a decompiled file.....

Not original hard to read and not complete

ultimatefx
34
ultimatefx 2012.01.10 19:44  
deVries:

Thanks so much for ur comment..i was improve my EA and this is The revision of my EA, please check it out !!!

Code in comments given is a decompiled file.....

Not original hard to read and not complete

This is my backtest a month..how do u think??

This is use MaxPercentageRisk 50% :)

shivam patel
103
shivam patel 2012.01.11 07:01  

hey

anyone can post modified file

or full code??

ultimatefx
34
ultimatefx 2012.01.11 08:50  
sam14985:

hey

anyone can post modified file

or full code??




The Last Version of My EA ready for publishing..

Just Wait...

btw i have sent to u mr sam by email...thanks so much for ur respected to this EA

Lets Go To Big Profit..Amien :D

Tjipke de Vries
6314
Tjipke de Vries 2012.01.11 09:55  
danufisika:
deVries:

Thanks so much for ur comment..i was improve my EA and this is The revision of my EA, please check it out !!!

Code in comments given is a decompiled file.....

Not original hard to read and not complete

This is my backtest a month..how do u think??

This is use MaxPercentageRisk 50% :)


Backtest a month

and This is use MaxPercentageRisk 50% :)

Then I think lucky there is no loss...... Because when there is a loss it can loose a lot and trading with that risk several pairs Margin Call ???

What settings did you use was it found by optimizing and what EA was the test doing is it the decompiled file or the EA you have given for download....

And a month is not long enough to tell you my opinion about this testing......

I can this way only say it looks too good to believe...

ultimatefx
34
ultimatefx 2012.01.11 10:27  
deVries:
danufisika:
deVries:

Thanks so much for ur comment..i was improve my EA and this is The revision of my EA, please check it out !!!

Code in comments given is a decompiled file.....

Not original hard to read and not complete

This is my backtest a month..how do u think??

This is use MaxPercentageRisk 50% :)


Backtest a month

and This is use MaxPercentageRisk 50% :)

Then I think lucky there is no loss...... Because when there is a loss it can loose a lot and trading with that risk several pairs Margin Call ???

What settings did you use was it found by optimizing and what EA was the test doing is it the decompiled file or the EA you have given for download....

And a month is not long enough to tell you my opinion about this testing......

I can this way only say it looks too good to believe...

Thanks so much Mr DeVries, actually i created this EA using Molanis Strategy Builder Software but trial 10 days only, check it out http://www.molanis.com..,,and the trial version of this software builder generated in EX4 only,,thats way i decompiled this EA to MQ4, http://ex4tomq4.net/ this backtest no more loss because im using hedge methode..ur statement is correct im not recommnd to use MaxPercentageRisk 50% for real account, im use 10% in my real account.

this is my best setting

Period1 = 5

Period2 = 13

Period3 = 34

Mode = 0

MicroAcc = True

Completed Bars = False

Five Digit = True

Maximu Order Position = 3

Use Max Percentage = Tru, MaxPercentageRisk = 10%-20% (For Real Account)

Lot Managmnt = False

Use Martiangle = True, Martiangle Multiplier = 2, After Loss = True, After Win = True

Slippage = 3 s/d 13

Lot = 10 (for $ 10.000) or 0.5-1 (for $1000)

S_Symbol_TP_0 = 0 / THis is Take Profit for Sell

S_Symbol_SL_0 = 0 / THis is Stop Loss for Sell

S_Symbol_TS_0 = 5 / This is Trailing Stop

for buy condition same with sell conditon setting

Hedge = True...

Time Frame M5


THis is Result EURUSD with MaxPercentageRisk 20%


and still no more loss... :D


and this is GBPUSD with 10% of RiskPercentage


Have A Great Day For You Mr deVries :)

PazO82
5
PazO82 2012.01.11 22:30  

Hello,

you has made a good job. I think the result reports are very good.

Do you can post the full modified code or an link to this codefile, please?

ultimatefx
34
ultimatefx 2012.01.12 04:18  
PazO:

Hello,

you has made a good job. I think the result reports are very good.

Do you can post the full modified code or an link to this codefile, please?



Thanks so Much Mr. Pazo for ur comment,,actually The Last Version of My EA ready for publishing..just wait..

as soon as possble..

Have A Great Day For You..

:D

12345678...17
To add comments, please log in or register