System Trading

Maximize Your Trading Efficiency with the Risk Manager EA for MetaTrader 4
MetaTrader4
Maximize Your Trading Efficiency with the Risk Manager EA for MetaTrader 4

As traders, we know that doing our own technical analysis (TA) is key to unlocking the best results. With the Risk Manager EA, you get to choose the direction for your trades—whether you're going long or short. Just a heads up, hedging won't be an option here, but the EA will patiently wait for the right setup to execute your trades. The Level and Length settings correspond to the depth and duration of pullbacks. If you set a longer Length, the EA will scale in more aggressively, while larger Levels mean it will search for deeper pullbacks to optimize your entries. Close PL is the maximum floating profit/loss before the EA decides to close all open positions. Profit and Risk Limit are essential parameters to define how much profit or risk you're willing to take on a specific signal. Make sure to set these wisely! Capital Parameter will default to your account balance at the moment you attach the EA. If you're currently sitting on any floating losses or profits, you might want to adjust this. Setting it to 0 assumes you're starting fresh with your initial balance. Keep in mind, if you're trading multiple currency pairs, the hedging function won't be activated. If you want to use the hedging feature, ensure you disable the Multipair trading option when focusing on just one pair. The hedging function kicks in once your specified hedge level is reached, which represents the remaining percentage of risk. Lastly, the Maxsize parameter indicates the largest position the EA will scale into, while Layers represents how many smaller positions you want to spread that Maxsize across. For example, if you're looking to buy 1 lot and want to scale in 10 times, simply set Maxsize to 1 and Layers to 10.

2023.04.08
Mastering Grid Trading Algorithms in Volatile Markets with MetaTrader 4
MetaTrader4
Mastering Grid Trading Algorithms in Volatile Markets with MetaTrader 4

Hey fellow traders! If you're diving into the world of grid trading, especially during those rollercoaster market conditions, you’re in for a treat. Today, let's talk about setting up a grid trading algorithm using the MetaTrader 4 platform. Input Parameters: Take Profit (Tp): This is a key figure for your robot. It will take profit once it reaches Tp multiplied by your invested amount. A good range to consider is between 0.01 and 0.1. Slow Moving Average: This parameter determines the period of the moving average, helping you gauge the market trend. Multiplier: This is crucial for your volume management. The next order in your grid will be based on the last order size multiplied by this factor. Time Frame: Choose wisely! A recommendation is to use either the 1-hour chart (60 minutes) or the 15-minute chart. Now, let’s get into the nitty-gritty of the Expert Advisor (EA) functions: TotalOrderLots(): This function provides you with the total lot amounts you're currently using. CalcMaxLot: This will tell you the maximum lot size you can trade. CalcGridLot: Need to know your starting lot size based on your parameters? This function has you covered. Engulfing Functions: These will return a true value when a bullish or bearish engulfing candlestick pattern occurs, which is essential for decision-making. OpenOrderProfits: This function gives you an overview of profits from all open orders. CloseAllOrders: This nifty function will close all your orders after checking multiple times. Your EA will execute grid orders based on Average True Range (ATR) values, adding an extra layer of strategy to your trading game. So, whether you're new to grid trading or looking to refine your existing strategy, these insights will help you navigate the choppy waters of volatile markets. Happy trading!

2023.01.27
Unlocking the AK-47 Scalper EA: Your Ultimate MetaTrader 4 Companion
MetaTrader4
Unlocking the AK-47 Scalper EA: Your Ultimate MetaTrader 4 Companion

1. Input Parameters #define ExtBotName "AK-47 Scalper EA" //Bot Name #define  Version "1.00" //--- input parameters extern string  EASettings        = "---------------------------------------------"; //-------- <EA Settings> -------- input int      InpMagicNumber    = 124656;   //Magic Number extern string  TradingSettings   = "---------------------------------------------"; //-------- <Trading Settings> -------- input double   Inpuser_lot       = 0.01;     //Lots input double   InpSL_Pips        = 3.5;      //Stoploss (in Pips) input double   InpMax_spread     = 0.5;      //Maximum allowed spread (in Pips) (0 = floating) extern string  MoneySettings     = "---------------------------------------------"; //-------- <Money Settings> -------- input bool     isVolume_Percent  = true;     //Allow Volume Percent input double   InpRisk           = 3        //Risk Percentage of Balance (%) input string   TimeSettings      = "---------------------------------------------"; //-------- <Trading Time Settings> -------- input bool     InpTimeFilter     = true      //Trading Time Filter input int      InpStartHour      = 2         //Start Hour input int      InpStartMinute    = 30        //Start Minute input int      InpEndHour        = 21        //End Hour input int      InpEndMinute      = 0         //End Minute 2. Variable Initialization //--- Variables int      Pips2Points;               // Slippage  3 pips    3=points    30=points double   Pips2Double;               // Stoploss 15 pips    0.015      0.0150 int      InpMax_slippage   = 3;     // Maximum slippage allow_Pips. bool     isOrder           = false; // just open 1 order int      slippage; string   strComment        = ""; 3. Main Code a/ Expert Initialization Function int OnInit()   { //---      //3 or 5 digits detection    //Pip and point    if (Digits % 2 == 1)    {       Pips2Double  = _Point*10;       Pips2Points  = 10;       slippage = 10* InpMax_slippage;    }    else    {           Pips2Double  = _Point;       Pips2Points  =  1;       slippage = InpMax_slippage;    }    //---    return(INIT_SUCCEEDED);   } b/ Expert Tick Function void OnTick()   { //---      if(IsTradeAllowed() == false)      {       Comment("AK-47 EA\nTrade not allowed.");       return;      }             MqlDateTime structTime;        TimeCurrent(structTime);        structTime.sec = 0;               //Set starting time        structTime.hour = InpStartHour;        structTime.min = InpStartMinute;              datetime timeStart = StructToTime(structTime);               //Set Ending time        structTime.hour = InpEndHour;        structTime.min = InpEndMinute;        datetime timeEnd = StructToTime(structTime);               double acSpread = MarketInfo(Symbol(), MODE_SPREAD);        StopLevel = MarketInfo(Symbol(), MODE_STOPLEVEL);              strComment = "\n" + ExtBotName + " - v." + (string)Version;       strComment += "\nGMT time = " + TimeToString(TimeGMT(),TIME_DATE|TIME_SECONDS);       strComment += "\nTrading time = [" + (string)InpStartHour + "h" + (string)InpStartMinute + " --> " +  (string)InpEndHour + "h" + (string)InpEndMinute + "]";              strComment += "\nCurrent Spread = " + (string)acSpread + " Points";       strComment += "\nCurrent stoplevel = " + (string)StopLevel + " Points";              Comment(strComment);          //Update Values       UpdateOrders();              TrailingStop();              //Check Trading time       if(InpTimeFilter)       {          if(TimeCurrent() >= timeStart && TimeCurrent() < timeEnd)          {             if(!isOrder) OpenOrder();          }       }       else       {          if(!isOrder) OpenOrder();       }   } 3.1 Calculate Signal to Send Orders void OpenOrder(){       //int OrdType = OP_SELL;//-1;    double TP = 0;    double SL = 0;    string comment = ExtBotName;    //Calculate Lots    double lot1 = CalculateVolume();       //if(OrdType == OP_SELL){       double OpenPrice = NormalizeDouble(Bid - (StopLevel * _Point) - (InpSL_Pips/2) * Pips2Double, Digits);       SL = NormalizeDouble(Ask + StopLevel * _Point + InpSL_Pips/2 * Pips2Double, Digits);              if(CheckSpreadAllow())                                    //Check Spread       {          if(!OrderSend(_Symbol, OP_SELLSTOP, lot1, OpenPrice, slippage, SL, TP, comment, InpMagicNumber, 0, clrRed))          Print(__FUNCTION__,"--> OrderSend error ",GetLastError());       }    //} } 3.2 Calculate Volume double CalculateVolume()   {    double LotSize = 0;    if(isVolume_Percent == false)      {       LotSize = Inpuser_lot;      }    else      {       LotSize = (InpRisk) * AccountFreeMargin();       LotSize = LotSize /100000;       double n = MathFloor(LotSize/Inpuser_lot);       //Comment((string)n);       LotSize = n * Inpuser_lot;       if(LotSize < Inpuser_lot)          LotSize = Inpuser_lot;       if(LotSize > MarketInfo(Symbol(),MODE_MAXLOT))          LotSize = MarketInfo(Symbol(),MODE_MAXLOT);       if(LotSize < MarketInfo(Symbol(),MODE_MINLOT))          LotSize = MarketInfo(Symbol(),MODE_MINLOT);      }    return(LotSize);   } 3.3 EA Trailing Stop Functionality void TrailingStop()   {    for(int i = OrdersTotal() - 1; i >= 0; i--)      {       if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))         {          if((OrderMagicNumber() == InpMagicNumber) && (OrderSymbol() == Symbol()))   //_Symbol))            {             //For Sell Order             if(OrderType() == OP_SELL)               {                   //--Calculate SL when price changed                   double SL_in_Pip = NormalizeDouble(OrderStopLoss() - (StopLevel * _Point) - Ask, Digits) / Pips2Double;                   if(SL_in_Pip > InpSL_Pips){                         double newSL = NormalizeDouble(Ask + (StopLevel * _Point) + InpSL_Pips * Pips2Double, Digits);                         if(!OrderModify(OrderTicket(), OrderOpenPrice(), newSL, OrderTakeProfit(), 0, clrRed))                         {                            Print(__FUNCTION__,"--> OrderModify error ",GetLastError());                         }               }           }                          //For SellStop Order             else if(OrderType() == OP_SELLSTOP)               {                   double SL_in_Pip = NormalizeDouble(OrderStopLoss() - (StopLevel * _Point) - Ask, Digits) / Pips2Double;                                      if(SL_in_Pip < InpSL_Pips/2){                      double newOP = NormalizeDouble(Bid - (StopLevel * _Point) - (InpSL_Pips/2) * Pips2Double, Digits);                      double newSL = NormalizeDouble(Ask + (StopLevel * _Point) + (InpSL_Pips/2) * Pips2Double, Digits);                                           if(!OrderModify(OrderTicket(), newOP, newSL, OrderTakeProfit(), 0, clrRed))                      {                         Print(__FUNCTION__,"--> Modify PendingOrder error!", GetLastError());                         continue;                      }                          }               }            }      }   }

2023.01.14
Maximize Your Trading Efficiency with XP Forex Trade Manager for MT4
MetaTrader4
Maximize Your Trading Efficiency with XP Forex Trade Manager for MT4

If you're trading on MetaTrader 4, the XP Forex Trade Manager is a game changer for managing your open orders. This handy tool takes the hassle out of trading by automatically setting your Stop Loss and Take Profit levels whenever you open a new order. Plus, as the market moves, it can adjust your Stop Loss to Break Even or implement a Trailing Stop to lock in those profits. The Forex Trade Manager can manage orders for the current symbol where the Expert Advisor (EA) is active or for all your open trades, regardless of the symbol. It even offers a stealth mode, keeping your Stop Loss and Take Profit levels hidden from your broker, which can be a strategic advantage. Key Features of the XP Forex Trade Manager Set Stop Loss and Take Profit: Easily configure these levels in pips for your trades. Trailing Stop: This feature trails your Stop Loss as the price moves, ensuring your profits are protected. Break Even: Move your Stop Loss to Break Even at a specified distance to safeguard your trades. Parameters You Can Customize SLTP Params Stop Loss - Set your Stop Loss in pips. Take Profit - Define your Take Profit in pips. Break Even Settings UseBreakEven (true/false) - Enable the break-even function for your open trades. BEActivation - Profit in pips required to activate the break-even feature. BELevel - Additional distance in pips for placing the Stop Loss via the break-even function. Trailing Stop Settings UseTrailingStop (true/false) - Enable the trailing stop feature for your open trades. TSStart - Profit in pips to activate the trailing stop function. TSStep - Minimum pip difference to adjust the Stop Loss using the trailing stop. TSDistance - Distance in pips for placing the Stop Loss when using the trailing stop function. Behavior Settings StealthMode (true/false) - Hide your SL/TP levels from the broker, closing trades programmatically at those levels. OnlyCurrentPair (true/false) - Manage trades only from the current chart's symbol or all pairs. Additional Information All parameters for the trades and functions can be easily adjusted in the EA settings. The Forex Trade Manager also displays valuable information directly on your chart, including your current daily profit or loss in pips and your account currency.

2023.01.10
Master Your Trades with XP Forex Trade Manager Grid MT4
MetaTrader4
Master Your Trades with XP Forex Trade Manager Grid MT4

Hey fellow traders! If you're looking to streamline your trading process, the XP Forex Trade Manager Grid for MT4 might just be the tool you need. This Expert Advisor (EA) is designed to help you manage your orders effectively and hit your profit targets with less hassle. To get started, all you need to do is place your first order with a Take Profit (TP) level, run the EA, and set your desired profit in pips. From there, the EA takes over, managing your positions and working towards your specified pip target. This strategy is particularly useful for managing trades that you've opened manually on the current pair. The grid management strategy allows you to add positions to your existing trades at a specified distance in pips, managing up to 15 trades (or even fewer if you prefer). For the first three trades, you'll have individual take profits, but once you hit the fourth trade, the EA will close the entire grid at a common level—essentially breaking even. Plus, after closing a trade at TP, you can easily renew it. Just keep an eye on your risk; if your losses exceed the allowed percentage of your account balance, the cycle will close automatically. Key Parameters: Let's break down some of the important parameters: Additional Trade Params: AddNewTradeAfter: The distance in pips from the last trade after which new trades will be added to the grid. Take Profit: TakeProfit1Total: Total TP in pips required from the first position. TakeProfit1Partitive: Initial TP in pips for the first position in the cycle. TakeProfit1Offset: Minimum distance in pips from the last closed first position's TP required to renew this trade. TakeProfit 2/3: Individual TPs in pips for the second and third positions in the cycle. TakeProfit 4/5/6/…15Total: Total TP in pips for all positions in the cycle (when four or more trades are opened). Trade Params: MaxOrders: The maximum number of trades allowed in the grid. Risk Balance %: The maximum allowable loss as a percentage of your account balance, which will close all opened positions if exceeded. Lots: The lot size for trades opened by the EA. Slippage: The permitted slippage in points. Additional Info: All parameters and functions are customizable within the EA settings. Additionally, the Forex Trade Manager Grid displays important information on your chart, including profit/loss for the current cycle in both pips and your account currency.

2023.01.10
Mastering Mean Reversion: Your Go-To EA for MetaTrader 4
MetaTrader4
Mastering Mean Reversion: Your Go-To EA for MetaTrader 4

Welcome, fellow traders! Today, we're diving into the fascinating world of the Mean Reversion strategy, a powerful tool for trading major forex pairs on the daily time frame. Getting Started with Mean Reversion Test It Out First: Always give it a whirl on a demo account before jumping in with real cash. Trade with Open Candle Prices: This EA operates solely based on the price of the open candle! Manage Your Lots: If you're not keen on increasing your lot size after a losing trade, simply set IncreaseFactor=0. Now, let’s explore some key inputs you can tweak to optimize your trading experience: Use_TP_In_Money: Enable Take Profit in monetary terms (values: true/false). TP_In_Money: Set your Take Profit in money (values: 10-100). Use_TP_In_Percent: Enable Take Profit in percentage (values: true/false). TP_In_Percent: Set your Take Profit in percentage (values: 10-100). ---------------------Money Trailing Stop for Multiple Trades---------------------- Enable_Trailing: Enable trailing with money (values: true/false). Take Profit In Money: Set this in your current currency (values: 25-200). Stop Loss In Money: Set this in your current currency (values: 1-20). -------------------------------------------------------------------------------------- Exit: Close trades if the trend goes against you to control drawdown (values: true/false). BarsToCount: Specify how many bars to count (values: 1-20). Lots: Set your lot size (values: 0.01-1). Lots Size Exponent: Define the exponent for lot size (values: 1.01-2). IncreaseFactor: Determine how much to increase lots from total margin after a loss (values: 0.001-0.1). Stop_Loss: Set your stop loss (values: 30-500). Use a value of 600 for multiple trades. MagicNumber: Assign a magic number (values: 1-100000). TakeProfit: Set your take profit (values: 50-200). Again, use 600 for multiple trades. FastMA: Define your fast moving average (values: 1-20). SlowMA: Define your slow moving average (values: 50-200). Mom_Sell: Set the momentum sell trigger (values: 0.1-0.9). Mom_Buy: Set the momentum buy trigger (values: 0.1-0.9). ---------------------Control Drawdown----------------------------- UseEquityStop: Toggle equity stop (values: true/false). TotalEquityRisk: Set this value (values: 0.01-20). ------------------------------------------------------------------------------- Max_Trades: Define the maximum number of trades (values: 1-12). FractalNum: Set the number of highs and lows (values: 1-10). ----------------If You Use Only 1 Trade:----------------------- ///////////////////////////////////////////////////////////////////// USETRAILINGSTOP: Enable trailing stop (values: true/false). WHENTOTRAIL: Decide when to trail (values: 40-100). TRAILAMOUNT: Set the trail amount (values: 40-100). Distance From Candle: Specify the distance from the candle (values: 1-100). USECANDELTRAIL: Enable trailing stop based on the candle (values: true/false). X: Number of candles to consider (values: 1-100). USEMOVETOBREAKEVEN: Enable the break-even feature (values: true/false). WHENTOMOVETOBE: Set when to move to break-even (values: 1-30). PIPSTOMOVESL: Specify how many pips to move the stop loss (values: 1-30). Remember, it's wise to optimize this EA every few months using the same inputs mentioned above. You can utilize it as either a hedging grid EA or a single trade EA. If you're looking to perform a backtest, check out this helpful link: Backtest Guide. Happy trading!

2022.10.26
Maximize Your Trading with Trickerless for MetaTrader 4
MetaTrader4
Maximize Your Trading with Trickerless for MetaTrader 4

Strategy Tester Report Trickerless RHMP InstaForex-Europe.com (Build 1359) Symbol EURGBP (Euro vs Great British Pound) Period Daily (D1) 2021.10.15 00:00 - 2022.09.07 00:00 (2021.10.15 - 2022.09.08) Model Every tick (the most precise method based on all available least timeframes) Parameters TOOLS="TOOLS"; CloseAll=false; ContinueTrading=true; SAFE="SAFE"; SafeSpread=true; SafeGrowth=true; SafeExits=true; AllowHedge=true; EnableStop=false; StopOnlyFriday=false; SIGNAL="SIGNAL"; SignalA=true; SignalB=true; SignalC=true; TIME="TIME"; RefreshHours=26; NEWS="NEWS"; NewsStartHour=18; NewsEndHour=22; SleepSeconds=1440; PROFIT="PROFIT"; BasketProfit=1.06; OpenProfit=0.011; MinProfit=0.085; SafeProfit=0.005; GROWTH="GROWTH"; StopGrowth=0.075; DailyGrowth=0.045; STOP="STOP"; RelativeStop=0.19; HISTORY="HISTORY"; QueryHistory=14; TREND="TREND"; MinTrend=2; MaxTrend=9; CandleSpike=7; BACK_SYSTEM="BACK_SYSTEM"; TriggerBackSystem=0.995; TrendSpace=5; MARGIN="MARGIN"; MinMarginLevel=300; MarginUsage=0.03; BackupMargin=0.05; NewsMargin=0.04; TRADE="TRADE"; MinLots=0.03; TradeSpace=3.5; MaxSpread=7; INDICATOR_ATR="INDICATOR_ATR"; ATRPeriod=14; INDICATOR_ADX="INDICATOR_ADX"; ADXMain=10; ADXPeriod=14; ADXShiftCheck=4; INDICATOR_MA="INDICATOR_MA"; MA1Period=120; MA2Period=60; MAShiftCheck=30; Bars in test 1235 Ticks modelled 5,326,472 Modelling quality 58.38% Mismatched charts errors 0 Initial deposit £10.00 Spread 30 Total net profit £216.31 Gross profit £216.40 Gross loss -£0.09 Profit factor 2361.41 Expected payoff £3.93 Absolute drawdown £4.88 Maximal drawdown £83.94 (77.54%) Relative drawdown 77.54% (83.94) Total trades 55 Short positions (won %) 27 (96.30%) Long positions (won %) 28 (100.00%) Profit trades (% of total) 54 (98.18%) Loss trades (% of total) 1 (1.82%) Largest profit trade £17.83 loss trade -£0.09 Average profit trade £4.01 loss trade -£0.09 Maximum consecutive wins (profit in money) 51 (£215.11) consecutive losses (loss in money) 1 (-£0.09) Maximal consecutive profit (count of wins) £215.11 (51) consecutive loss (count of losses) -£0.09 (1) Average consecutive wins 27 consecutive losses 1 # Time Type Order Size Price S / L T / P Profit Balance 1 2021.10.15 13:30 buy 1 0.03 0.84547 0.00000 0.00000 2 2021.10.19 08:00 close 1 0.03 0.84561 0.00000 0.00000 £0.02 £10.02 3 2021.10.19 08:24 sell 2 0.03 0.84555 0.00000 0.00000 4 2021.10.19 14:35 close 2 0.03 0.84306 0.00000 0.00000 £0.86 £10.88 5 2021.10.22 12:00 buy 3 0.03 0.84284 0.00000 0.00000 6 2021.10.22 14:00 close 3 0.03 0.84403 0.00000 0.00000 £0.41 £11.29 7 2021.10.26 15:18 sell 4 0.03 0.84194 0.00000 0.00000 8 2021.11.17 14:00 close 4 0.03 0.84193 0.00000 0.00000 -£0.09 £11.20 9 2021.11.23 16:40 buy 5 0.03 0.84129 0.00000 0.00000 10 2021.11.26 06:00 close 5 0.03 0.84335 0.00000 0.00000 £0.63 £11.83 11 2021.12.07 08:36 sell 6 0.04 0.85027 0.00000 0.00000 12 2021.12.16 14:01 close 6 0.04 0.84806 0.00000 0.00000 £0.94 £12.77 13 2021.12.17 09:48 buy 7 0.04 0.85057 0.00000 0.00000 14 2021.12.20 10:39 close 7 0.04 0.85293 0.00000 0.00000 £1.07 £13.84 15 2021.12.22 00:00 sell 8 0.04 0.85085 0.00000 0.00000 16 2021.12.22 06:00 close 8 0.04 0.85081 0.00000 0.00000 £0.02 £13.86 17 2021.12.23 13:10 buy 9 0.04 0.84439 0.00000 0.00000 18 2021.12.24 10:00 close 9 0.04 0.84496 0.00000 0.00000 £0.24 £14.10 19 2021.12.24 10:24 sell 10 0.04 0.84499 0.00000 0.00000 20 2021.12.27 16:00 close 10 0.04 0.84270 0.00000 0.00000 £1.04 £15.14 21 2022.01.05 18:29 buy 11 0.05 0.83506 0.00000 0.00000 22 2022.01.06 10:00 close 11 0.05 0.83621 0.00000 0.00000 £0.58 £15.72 23 2022.01.11 13:56 sell 12 0.05 0.83449 0.00000 0.00000 24 2022.01.11 20:00 close 12 0.05 0.83401 0.00000 0.00000 £0.27 £15.99 25 2022.01.18 16:23 buy 13 0.05 0.83659 0.00000 0.00000 26 2022.01.24 17:02 close 13 0.05 0.83896 0.00000 0.00000 £1.21 £17.20 27 2022.01.24 20:00 sell 14 0.05 0.84179 0.00000 0.00000 28 2022.01.25 08:42 close 14 0.05 0.83922 0.00000 0.00000 £1.47 £18.68 29 2022.01.25 22:00 buy 15 0.06 0.83643 0.00000 0.00000 30 2022.02.03 17:21 close 15 0.06 0.83873 0.00000 0.00000 £1.24 £19.92 31 2022.02.04 16:00 sell 16 0.06 0.84629 0.00000 0.00000 32 2022.02.04 16:00 close 16 0.06 0.84628 0.00000 0.00000 £0.01 £19.93 33 2022.02.04 16:54 buy 17 0.06 0.84478 0.00000 0.00000 34 2022.02.07 14:26 close 17 0.06 0.84724 0.00000 0.00000 £1.67 £21.60 35 2022.02.08 13:58 sell 18 0.06 0.84341 0.00000 0.00000 36 2022.02.09 00:00 close 18 0.06 0.84302 0.00000 0.00000 £0.26 £21.86 37 2022.02.15 23:33 buy 19 0.07 0.83894 0.00000 0.00000 38 2022.02.16 14:00 close 19 0.07 0.83963 0.00000 0.00000 £0.51 £22.37 39 2022.02.16 21:03 sell 20 0.07 0.83788 0.00000 0.00000 40 2022.02.17 06:03 close 20 0.07 0.83550 0.00000 0.00000 £1.89 £24.26 41 2022.02.22 17:55 buy 21 0.07 0.83562 0.00000 0.00000 42 2022.02.25 15:47 close 21 0.07 0.83819 0.00000 0.00000 £1.89 £26.14 43 2022.02.28 12:00 sell 22 0.08 0.83561 0.00000 0.00000 44 2022.03.01 13:13 close 22 0.08 0.83318 0.00000 0.00000 £2.23 £28.37 45 2022.03.02 03:23 buy 23 0.09 0.83485 0.00000 0.00000 46 2022.03.09 16:06 close 23 0.09 0.83720 0.00000 0.00000 £2.10 £30.47 47 2022.03.14 00:13 sell 24 0.09 0.83757 0.00000 0.00000 48 2022.03.22 04:00 close 24 0.09 0.83671 0.00000 0.00000 £0.78 £31.25 49 2022.03.24 12:12 buy 25 0.09 0.83336 0.00000 0.00000 50 2022.03.25 09:53 close 25 0.09 0.83595 0.00000 0.00000 £2.63 £33.88 51 2022.03.28 18:45 sell 26 0.10 0.83834 0.00000 0.00000 52 2022.04.05 06:00 close 26 0.10 0.83663 0.00000 0.00000 £1.85 £35.73 53 2022.04.07 09:02 buy 27 0.11 0.83427 0.00000 0.00000 54 2022.04.11 00:00 close 27 0.11 0.83765 0.00000 0.00000 £4.16 £39.89 55 2022.04.13 05:36 sell 28 0.12 0.83275 0.00000 0.00000 56 2022.04.13 22:00 close 28 0.12 0.83059 0.00000 0.00000 £2.98 £42.87 57 2022.04.18 14:06 buy 29 0.13 0.82901 0.00000 0.00000 58 2022.04.20 10:00 close 29 0.13 0.83011 0.00000 0.00000 £1.50 £44.37 59 2022.04.21 11:40 sell 30 0.13 0.83619 0.00000 0.00000 60 2022.04.21 16:33 close 30 0.13 0.83365 0.00000 0.00000 £3.80 £48.17 61 2022.04.25 07:59 buy 31 0.14 0.84195 0.00000 0.00000 62 2022.04.26 18:43 close 31 0.14 0.84450 0.00000 0.00000 £4.03 £52.20 63 2022.04.27 21:03 sell 32 0.16 0.84181 0.00000 0.00000 64 2022.04.28 00:00 close 32 0.16 0.84167 0.00000 0.00000 £0.19 £52.38 65 2022.04.28 20:07 buy 33 0.16 0.84322 0.00000 0.00000 66 2022.05.05 07:42 close 33 0.16 0.84567 0.00000 0.00000 £3.92 £56.30 67 2022.05.05 15:20 sell 34 0.17 0.85211 0.00000 0.00000 68 2022.05.12 19:57 close 34 0.17 0.84966 0.00000 0.00000 £4.61 £60.91 69 2022.05.13 04:00 buy 35 0.18 0.85052 0.00000 0.00000 70 2022.05.16 10:00 close 35 0.18 0.85089 0.00000 0.00000 £0.67 £61.59 71 2022.05.16 10:24 sell 36 0.18 0.85117 0.00000 0.00000 72 2022.05.16 17:14 close 36 0.18 0.84863 0.00000 0.00000 £5.26 £66.85 73 2022.05.17 12:00 buy 37 0.20 0.84098 0.00000 0.00000 74 2022.05.17 13:37 close 37 0.20 0.84347 0.00000 0.00000 £5.73 £72.58 75 2022.05.18 14:00 sell 38 0.22 0.84821 0.00000 0.00000 76 2022.05.18 17:39 close 38 0.22 0.84577 0.00000 0.00000 £6.17 £78.75 77 2022.05.20 09:06 buy 39 0.24 0.84790 0.00000 0.00000 78 2022.05.24 00:00 close 39 0.24 0.84899 0.00000 0.00000 £2.76 £81.50 79 2022.05.24 12:04 sell 40 0.24 0.85773 0.00000 0.00000 80 2022.05.25 02:00 close 40 0.24 0.85627 0.00000 0.00000 £3.99 £85.49 81 2022.05.25 02:24 buy 41 0.26 0.85597 0.00000 0.00000 82 2022.06.03 20:00 close 41 0.26 0.85721 0.00000 0.00000 £2.20 £87.69 83 2022.06.03 20:24 sell 42 0.26 0.85730 0.00000 0.00000 84 2022.06.06 11:29 close 42 0.26 0.85478 0.00000 0.00000 £7.50 £95.19 85 2022.06.07 02:00 buy 43 0.29 0.85372 0.00000 0.00000 86 2022.06.07 08:26 close 43 0.29 0.85615 0.00000 0.00000 £8.11 £103.30 87 2022.06.08 07:50 sell 44 0.31 0.85024 0.00000 0.00000 88 2022.07.07 17:55 close 44 0.31 0.84777 0.00000 0.00000 £7.33 £110.63 89 2022.07.11 20:33 buy 45 0.33 0.84603 0.00000 0.00000 90 2022.07.14 18:02 close 45 0.33 0.84851 0.00000 0.00000 £8.55 £119.18 91 2022.07.18 17:21 sell 46 0.36 0.84764 0.00000 0.00000 92 2022.07.26 16:02 close 46 0.36 0.84519 0.00000 0.00000 £9.71 £128.89 93 2022.07.26 22:00 buy 47 0.39 0.84171 0.00000 0.00000 94 2022.08.05 15:58 close 47 0.39 0.84416 0.00000 0.00000 £8.52 £137.41 95 2022.08.08 17:53 sell 48 0.41 0.84293 0.00000 0.00000 96 2022.08.16 12:00 close 48 0.41 0.84245 0.00000 0.00000 £1.76 £139.17 97 2022.08.18 06:31 buy 49 0.42 0.84478 0.00000 0.00000 98 2022.08.19 11:05 close 49 0.42 0.84723 0.00000 0.00000 £11.62 £150.79 99 2022.08.23 09:08 sell 50 0.45 0.84458 0.00000 0.00000 100 2022.08.23 18:52 close 50 0.45 0.84210 0.00000 0.00000 £12.85 £163.64 101 2022.08.25 06:04 buy 51 0.49 0.84505 0.00000 0.00000 102 2022.08.26 16:27 close 51 0.49 0.84752 0.00000 0.00000 £13.66 £177.30 103 2022.08.29 12:00 sell 52 0.53 0.85234 0.00000 0.00000 104 2022.08.29 12:00 close 52 0.53 0.85231 0.00000 0.00000 £0.18 £177.48 105 2022.08.30 02:51 buy 53 0.53 0.85400 0.00000 0.00000 106 2022.08.30 13:32 close 53 0.53 0.85648 0.00000 0.00000 £15.13 £192.61 107 2022.08.30 19:00 sell 54 0.58 0.85975 0.00000 0.00000 108 2022.09.06 13:16 close 54 0.58 0.85728 0.00000 0.00000 £15.86 £208.48 109 2022.09.07 10:13 buy 55 0.63 0.86144 0.00000 0.00000 110 2022.09.07 13:48 close 55 0.63 0.86390 0.00000 0.00000 £17.83 £226.31

2022.06.28
How to Detect New Candle Starts in MetaTrader 4: A Simple Guide
MetaTrader4
How to Detect New Candle Starts in MetaTrader 4: A Simple Guide

Hey there, fellow traders! Today, we're diving into how to detect the beginning of a new candle in MetaTrader 4, a handy skill for anyone using an Expert Advisor (EA). Unlike ticking quotes, which trigger the OnTick() function, there’s no built-in function for when a new bar starts. But don’t worry; I’ve got you covered! To figure out when a new bar opens, we need to keep an eye on the opening time of the most recent candle. Once that changes, we know a new bar has started, and we can take action. Below is a sample code that works for both MQL4 and MQL5: // Default tick event handler    void OnTick()    {       // Check for new bar (compatible with both MQL4 and MQL5).          static datetime dtBarCurrent  = WRONG_VALUE;                 datetime dtBarPrevious = dtBarCurrent;                          dtBarCurrent  = iTime( _Symbol, _Period, 0 );                 bool     bNewBarEvent  = ( dtBarCurrent != dtBarPrevious );       // React to a new bar event and handle it.          if( bNewBarEvent )          {             // Detect if this is the first tick received and handle it.                /* For example, when it is first attached to a chart and                   the bar is somewhere in the middle of its progress and                   it's not actually the start of a new bar. */                if( dtBarPrevious == WRONG_VALUE )                {                   // Do something on first tick or middle of bar ...                }                else                {                   // Do something when a normal bar starts ...                };             // Do something irrespective of the above condition ...          }          else          {             // Do something else ...          };       // Do other things ...    }; In this code, the static variable tracks the bar's opening time, keeping its value even after we leave the OnTick() function. This is crucial for spotting when the current bar's opening time shifts. Don't forget, when you first place the EA on a chart, the code will act as if a new bar has just opened, so make sure to handle that condition if it needs a different approach. And just a heads up, you can now find all my CodeBase publications' source code in the "Public Projects" tab of MetaEditor under the name "FMIC". Happy trading!

2022.04.24
Mastering Martingale Strategy with Expert Advisors on MetaTrader 4
MetaTrader4
Mastering Martingale Strategy with Expert Advisors on MetaTrader 4

If you're diving into the world of trading with MetaTrader 4, you might have stumbled upon the term 'Martingale.' But what does it really mean, and how can it enhance your trading strategy? Let's break it down together! This Expert Advisor (EA) showcases how to effectively implement the Martingale strategy based on signals from any indicator you choose. It's all about leveraging the ups and downs of the market to your advantage. What is the Martingale Strategy? The Martingale strategy is a betting strategy that involves doubling your investment after every loss, aiming to recover past losses with a single win. In trading, this means that if a trade doesn’t go your way, you increase your position size on the next trade. Why Use an Expert Advisor? Implementing the Martingale strategy manually can be a daunting task, especially when emotions come into play. That's where an EA comes in handy! It automates your trades based on predefined signals, allowing you to stick to the strategy without second-guessing yourself. Getting Started with the EA Choose Your Indicator: Select an indicator that you trust and find reliable. Set Your Parameters: Customize the EA settings according to your risk tolerance and trading goals. Monitor Your Trades: Keep an eye on the performance and make adjustments as needed. Remember, while the Martingale strategy can be powerful, it also comes with its risks. Always trade responsibly and do your homework before diving in!

2022.01.30
First Previous 1 2 3 4 5 6 7 8 9 Next Last