System Trading

Understanding Bounce Numbers for Grid and Martingale Strategies in MetaTrader 4
MetaTrader4
Understanding Bounce Numbers for Grid and Martingale Strategies in MetaTrader 4

When it comes to trading strategies like Grid and Martingale, one of the key aspects you need to get right is your lot sizing and the number of trades. It’s crucial for maximizing your success and minimizing your risk. As traders, we often look back at a symbol’s historical performance, especially during range zones. A question we frequently ponder is: How Many Times did the price bounce between the two limits of a range zone? This concept is what I call the Bounce Number. It can be calculated through statistical analysis of any symbol’s historical data from the market. To clarify this further, let’s take a look at Image No. 1. Image No. 1: Definition of Bounce Number, its goal, and applications The image illustrates how price movement generates statistics for the Bounce Number Tool. To manage delays, I developed it as an Expert Advisor (EA) that employs a Sleep function. This function helps prevent crashes on your chart, especially when dealing with a high number of candles set in the tool's input. Now, let’s take a look at Image No. 2, which presents a brief graphical representation of the tool and what the different objects mean. Image No. 2: Bounce Number Statistics. Using the Tool: Referring to Image No. 2, let’s say we set the Bouncing Channel Half Height to 600 points: We can identify 6 different bounce numbers ranging from 1 to 6 for this symbol. A bounce number of 2 indicates that the price starts from the middle of the bounce channel (height of 2 * 600 = 1200 points), moving up and down, touching the red line once and the blue line once before reaching the Take Profit (TP) of 1200 points. For bounce number 5, the price starts from the mid-point of the channel and touches the red line 2 times and the blue line 3 times, or vice versa, before hitting the TP of 1200 points. This logic applies to all bounce numbers. There is no bounce number 7, which means the price hasn’t bounced between the red and blue lines 7 times (with a distance of 1200 points) over the entire historical data selected in the tool’s input. Keep in mind that the more historical data you use (the Max number of lookback candles), the greater the chance of identifying 7 bounces. However, even for 6 bounces, the chance is only 22 out of 9020 total price hits at TPs. Input Settings for the Tool: - Max number of lookback candles: Like with any scanning tool, be cautious about how many you set here. Avoid increasing it too dramatically to prevent crashes due to memory overload. - Time-Frame: The time frame of the candles you want to analyze for bounces from channel limits and TP line touches. A lower time frame is preferable for narrow channels. If you’re unsure, it’s best to stick with the M1 time frame. - Bouncing Channel Half Height: This is the distance in points between the green line and the red and blue lines. - Chart Background Color: Set this to your preference. - Bar Chart Color 1/Bar Chart Color 2: Use these to add a bit of flair to your statistical bars. - Count Cells Color: Choose a color for the count cells. - Bounce Numbers Cell Color: Pick a color for the bounce numbers cell. - Load Bar Color: This load bar will indicate whether the tool is working and how quickly calculations are progressing. Additionally, a button has been added to start the calculations and to enter the number of historical candles directly from the screen.

2024.01.12
Sound Alerts for Connection Status in MetaTrader 5
MetaTrader5
Sound Alerts for Connection Status in MetaTrader 5

If you're looking to enhance your trading experience, adding sound alerts for connection status in MetaTrader 5 is a game-changer. This simple utility will notify you with sound cues whenever your connection status changes, ensuring you never miss a beat. To get started, you’ll need to add your sound files to the MQL5\Files\Sounds directory. Once that’s done, you can copy the provided code into your EA Utility and compile it. Just a heads-up: the use of #resource can complicate uploads, so be mindful of that. How to Implement the Sound Alert Here's a quick rundown of the code you'll need: //+------------------------------------------------------------------+//| Connect_Disconnect_Sound_Alert.mq5 |//| Copyright 2024, Rajesh Kumar Nait |//| https://www.mql5.com/en/users/rajeshnait/seller |//+------------------------------------------------------------------+#property copyright "Copyright 2024, Rajesh Kumar Nait"#property link "https://www.mql5.com/en/users/rajeshnait/seller"#property version "1.00"#include bool first = true;bool Now_IsConnected = false;bool Pre_IsConnected = true;datetime Connect_Start = 0, Connect_Stop = 0;CTerminalInfo terminalInfo;//--- Sound files#resource "\Files\Sounds\CONNECTED.wav"#resource "\Files\Sounds\DISCONNECTED.wav"//+------------------------------------------------------------------+int OnInit(){ ResetLastError(); while (!IsStopped()) { Pre_IsConnected = Now_IsConnected; Now_IsConnected = terminalInfo.IsConnected(); if (first) { Pre_IsConnected = !Now_IsConnected; } if (Now_IsConnected != Pre_IsConnected) { if (Now_IsConnected) { Connect_Start = TimeLocal(); if (!first) { if (!PlaySound("::Files\Sounds\DISCONNECTED.wav")) Print("Error: ", GetLastError()); } if (IsStopped()) break; if (!PlaySound("::Files\Sounds\CONNECTED.wav")) Print("Error: ", GetLastError()); } else { Connect_Stop = TimeLocal(); if (!first) { if (!PlaySound("::Files\Sounds\CONNECTED.wav")) Print("Error: ", GetLastError()); } if (IsStopped()) break; if (!PlaySound("::Files\Sounds\DISCONNECTED.wav")) Print("Error: ", GetLastError()); } } first = false; Sleep(1000); } return(INIT_SUCCEEDED);}//+------------------------------------------------------------------+ If you want to see this in action, check out the video below:

2024.01.08
Unlocking Advanced MQL5 Tools for MetaTrader 5: Your Guide to Enhanced Trading
MetaTrader5
Unlocking Advanced MQL5 Tools for MetaTrader 5: Your Guide to Enhanced Trading

Part 7: Advanced MQL5 ToolsIn Part 7 of our series on MQL5 Programming for Traders, we dive into the advanced features of the MQL5 API that can supercharge your MetaTrader 5 experience. Whether you're developing custom indicators or automated trading systems, these tools will come in handy.This section focuses on libraries, which are special types of programs that offer ready-to-use APIs for connecting with other MQL programs. You’ll also learn about creating software packages and how to logically group related programs into cohesive projects.We’ll wrap things up by discussing integrations with other software environments, including Python, which opens up a whole new world of possibilities for your trading strategies.Let's kick things off with resources. These are files of any type that can be embedded directly in your program code. Resources can include:Multimedia elementsConfiguration settings from external applicationsCompiled forms of other MQL5 programsThe MQL5 development environment allows you to include application data arrays, images, sounds, and fonts right in your source file. This makes your program a self-sufficient and user-friendly product.We’ll put a spotlight on graphic resources, particularly raster images in BMP format. You’ll learn how to create, edit, and dynamically display these images right on your charts.Finally, we’ll conclude with a look at OpenCL integration in MQL5. OpenCL is an open standard for parallel programming on multiprocessor systems, including both GPUs and CPUs. This technology can significantly speed up computationally heavy tasks, such as training neural networks or performing Fourier transforms.To use OpenCL in your MQL programs, you'll need special drivers and support for OpenCL version 1.1 or higher. Don't worry if you don't have a dedicated graphics card; your CPU can also handle parallel computing tasks.

2023.12.16
Mastering MQL5: Your Guide to Trading Automation in MetaTrader 5
MetaTrader5
Mastering MQL5: Your Guide to Trading Automation in MetaTrader 5

Part 6: Trading Automation Welcome back to our series on MQL5 Programming for Traders! In this segment, we're diving into the exciting world of trading automation. This part is crucial for anyone looking to enhance their trading game with Expert Advisors (EAs) in MetaTrader 5. We'll kick things off by exploring some essential components of the MQL5 language, starting with the basics like financial instrument specifications and trading account settings. Understanding these elements is key to creating EAs that work seamlessly. After that, we'll delve into built-in functions, data structures, and the robot-specific events that make up the backbone of Expert Advisor operations in the strategy tester. The MetaTrader 5 Strategy Tester is a game-changer for developing trading robots. It allows you to evaluate performance and fine-tune your strategies effectively. You'll have access to vital tools for debugging in various modes, including visual testing with bars or ticks, whether they're modeled or real. Plus, you can visually reproduce the flow of quotes, or even run tests without the visual interface! In our previous discussions, we touched on testing indicators in visual mode, but let's face it – the options are quite limited there. When we develop EAs, we unlock the full potential of the strategy tester's capabilities. Moving on, we’ll also take a closer look at how market data is represented, specifically through the Depth of Market (DOM) and its software interface. MetaTrader 5 gives you the tools to analyze and trade various financial instruments (symbols) that are the foundation of all terminal subsystems. Users can pick from a list of symbols provided by their broker and keep an eye on them in the Market Watch. With the MQL5 API, you can easily view and analyze all symbol characteristics, adding or removing them from your Market Watch as needed. And it doesn’t stop there! In addition to the standard symbols your broker provides, MetaTrader 5 allows you to create custom symbols. You can load their properties and quoting history from various data sources or even calculate them using formulas and MQL5 programs.

2023.12.16
Unlocking MQL5: A Trader's Guide to Creating Applications in MetaTrader 5
MetaTrader5
Unlocking MQL5: A Trader's Guide to Creating Applications in MetaTrader 5

Part 5: Crafting Applications with MQL5 Welcome back, fellow traders! In this installment of "Part 5: Crafting Applications with MQL5", we’re going to dive deep into the exciting world of algorithmic trading. We'll cover everything from financial data analysis to chart visualization, automation, and user interactions. First off, let’s break down the essentials of creating MQL programs. We’ll explore the various event types, features, and models that you can find in the MetaTrader terminal. You’ll also learn how to access time series data, manipulate charts, and work with graphical objects. Plus, we’ll touch on the principles for crafting and applying each type of MQL program. The MetaTrader 5 platform is pretty versatile, supporting five different types of programs: technical indicators, Expert Advisors (or EAs for short), scripts for one-off tasks, services that run in the background, and libraries for those specialized functional modules. Next, we’re going to get our hands dirty with indicators and charts. We’ll learn some nifty techniques that are also relevant for building Expert Advisors. Don’t worry; the development of EAs will be the focus of the next part of our series. We’ll get into the nitty-gritty of automating orders, formalizing trading strategies, and even testing and optimizing them using historical data. We’ll also discover how to utilize the built-in standard indicators and how to whip up custom applications from scratch or modify existing indicators. Just a heads-up: all compiled programs will show up in the Navigator of MetaTrader 5, except for EX5 libraries, which are used by other programs but won’t be visible in the Navigator themselves. By the end of this journey, you’ll have a solid grasp of what MQL5 can do for you in the realm of algorithmic trading. This knowledge will empower you to work more effectively with financial data, creating your own trading indicators and Expert Advisors.

2023.12.16
Mastering MQL5 APIs: Essential Functions for MetaTrader 5 Traders
MetaTrader5
Mastering MQL5 APIs: Essential Functions for MetaTrader 5 Traders

Part 4: Common MQL5 APIs Hey fellow traders! Welcome back to our deep dive into MQL5 programming. In previous posts, we've scratched the surface of MQL5, covering its syntax and core concepts. Now, it's time to roll up our sleeves and get into the nitty-gritty of building practical applications for automated trading and data processing using MetaTrader 5. In this section, "Part 4: Common MQL5 APIs", we're going to focus on mastering the built-in functions of the MQL5 API. These functions are essential tools in our trading toolbox, allowing us to interact seamlessly with the MetaTrader 5 terminal. We’ll start with the basics—functions that you can easily incorporate into most of your trading programs. We’ll cover a variety of topics, including: Array operations String processing File interactions Data conversion User interaction functions Mathematical functions Program environment management One of the great things about MQL5 is that you don’t need to worry about additional preprocessor directives when using its built-in functions. All MQL5 API functions are readily available in the global context, which means you can access them without any fuss. We’ll also touch on handling similar function names in different contexts, like class methods or custom namespaces. When that happens, you can use the context resolution operator to call the global function, a topic we covered earlier when discussing nested types and namespaces. Programming often involves juggling different data types. In our earlier discussions, we explored both explicit and implicit conversion methods for built-in data types. However, these might not always meet your needs. That’s where the MQL5 API shines—it includes a suite of conversion functions designed to give you more control over how you convert between types. We’ll pay special attention to functions that help convert between strings and other types such as numbers, dates, colors, structures, and enumerations.

2023.12.15
Mastering MQL5: A Trader's Guide to Object-Oriented Programming
MetaTrader5
Mastering MQL5: A Trader's Guide to Object-Oriented Programming

Part 3: Delving into Object-Oriented Programming with MQL5Explore Part 3: Object-Oriented Programming in MQL5 and dive deep into the essentials of object-oriented programming (OOP) within the MQL5 language. If you've ever felt overwhelmed by managing multiple entities in your trading systems, then this guide is just what you need to boost your programming efficiency and output quality.OOP is all about leveraging objects, which are custom type variables defined by you, the programmer, using MQL5 tools. By creating these custom types, you can effectively model your trading objects, making it simpler to write and maintain your programs.In this segment, we’ll explore how to define new types through classes, structures, and unions. These custom types allow you to seamlessly combine data and algorithms, giving you the power to describe the state and behavior of your trading applications.The author emphasizes the "divide and conquer" principle, illustrating how each object acts as a mini-program, tackling a specific, well-defined task. By combining these objects, you can create a cohesive system to develop complex trading products and services.To help you get the most out of MQL5, this section introduces the foundational principles of OOP, complete with practical examples. You’ll also discover the versatility of templates, interfaces, and namespaces, revealing the true power of OOP in crafting robust MQL5 applications.

2023.12.15
Unlocking MQL5: Your Guide to Programming for MetaTrader 5
MetaTrader5
Unlocking MQL5: Your Guide to Programming for MetaTrader 5

Part 1: Getting Started with MQL5 and Your Development Setup Welcome to the first section of our journey through "Introduction to MQL5 and Development Environment". Here, we’ll dive into the essentials of MQL5, the programming language designed for MetaTrader 5. If you're coming from MQL4, you'll notice that MQL5 opens up a world of possibilities with its support for object-oriented programming (OOP), much like C++. Now, while some OOP concepts have trickled down to MQL4, for many users, especially those new to coding, OOP can seem a bit daunting. The aim of this guide is to break down these complexities and make learning MQL5 as straightforward as possible. Think of this book as your trusty sidekick, complementing the MQL5 reference by delving into all aspects of programming while explaining them in detail. Plus, you can choose to stick with either an object-oriented approach or a procedural style—or even mix the two! If you're already familiar with programming, feel free to skip the introductory bits. For those of you who’ve dabbled in C++, you might find MQL5 a walk in the park. Just keep an eye out for the differences to avoid any hiccups. With MQL5, you can whip up various types of applications, like indicators that visually display data, Expert Advisors (EAs) to automate your trading, scripts for one-off tasks, and services for running jobs in the background. What sets MetaTrader 5 apart is the ability to control your entire trading system right from the client terminal. This is where your MQL5 programs will run and send trade commands to the server—rest assured, MQL5 applications don’t get installed on the server itself. This first part will guide you through editing, compiling, and running your programs. We’ll also cover different data types, variables, expressions, arrays, debugging techniques, and how to output your results effectively.

2023.12.15
Recognizing Handwritten Digits with ONNX in MetaTrader 5: A Step-by-Step Guide
MetaTrader5
Recognizing Handwritten Digits with ONNX in MetaTrader 5: A Step-by-Step Guide

An Expert Advisor for Handwritten Digit Recognition If you're diving into the world of algorithmic trading, you might want to explore how to utilize models for tasks like recognizing handwritten digits. One popular dataset for this is the MNIST database, which includes 60,000 training images and 10,000 testing images. These images have been generated by remixing the original NIST set of 20x20 pixel black-and-white samples, sourced from the US Census Bureau and enriched with samples from American high school students. Each image has been normalized to a size of 28x28 pixels and anti-aliased to introduce various grayscale levels. For trading enthusiasts looking to implement this, the trained model mnist.onnx is available for download on GitHub from the Model Zoo (opset 8). You can easily download and test other models, but be cautious to avoid those using opset 1, as they aren't supported by the latest ONNX runtime. Interestingly, the output vector isn't processed with the Softmax activation function, which is typically standard in classification models. But don’t worry, we can implement that ourselves! int PredictNumber(void) {   static matrixf image(28, 28);   static vectorf result(10);   PrepareMatrix(image);   if(!OnnxRun(ExtModel, ONNX_DEFAULT, image, result)) {     Print("OnnxRun error ", GetLastError());     return(-1);  }   result.Activation(result, AF_SOFTMAX);   int predict = int(result.ArgMax());   if(result[predict] < 0.8)     Print(result);   Print("value ", predict, " predicted with probability ", result[predict]);   return(predict);} To recognize a drawn digit, simply draw it within a special grid using your mouse while holding down the left button. Once you’ve drawn your digit, hit the CLASSIFY button to see the result! If the recognized digit's probability is below 0.8, the resulting vector of probabilities for each class will be logged. For instance, if you classify an empty input field, you might see something like this: [0.095331445, 0.10048489, 0.10673151, 0.10274081, 0.087865397, 0.11471312, 0.094342403, 0.094900772, 0.10847695, 0.09441267] value 5 predicted with probability 0.11471312493085861 Interestingly, recognition accuracy tends to dip notably for the number nine (9), and left-slanted digits are recognized more accurately. So, keep that in mind as you experiment with your own digit recognition!

2023.11.23
Mastering Take Profit Strategies in MetaTrader 4: A Local Trader’s Guide
MetaTrader4
Mastering Take Profit Strategies in MetaTrader 4: A Local Trader’s Guide

IntroductionHey there, fellow traders! If you’re like most of us, you probably rely on your Expert Advisors (EAs) to manage your trades. But have you ever thought about how these EAs determine when to close orders at take profit? While many EAs stick to a simple pip-based approach, the EA Perceptron takes a different route—it focuses on your current profit instead. This makes managing take profit across multiple open positions so much easier, especially if you’re juggling several bots or EAs at once. Want to stay in the loop? Add me to your friends and follow my feed for updates!By using this profit-based method, you can sidestep some of the common headaches that come with pip-based take profits. For instance, if your broker experiences slippage, it could seriously limit your potential profits. With a current profit-based system, you gain better control over your trades, ensuring you don’t leave money on the table.If you’re curious about how to set up a take profit based on current profit, take a peek at the code for the EA SwingBot—it’s a great reference!…Total OrdersFirst things first, let’s look at the code that calculates the total number of open orders tied to the same magic number.The magic number is a unique identifier that you or your EA assigns to each order. Here’s how it works:The code kicks off by initializing a variable total_orders to zero. It then loops through all open orders using a for loop and selects each order with the OrderSelect() function. If the order is successfully selected, it bumps up the total_orders variable by one.//-----------------    int total_orders = 0;    for(int i = 0; i < OrdersTotal(); i++)      {       if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))         {          if(OrderMagicNumber() == MagicNumber)          {          total_orders++;         }         }     }…Calculating Current ProfitThe next step involves initializing two variables: ProfittoMinimo and Profit. The ProfittoMinimo variable sets the threshold for activating take profit, and its value is expressed in your account’s currency. The Profit variable accumulates the current profit from all open positions with the same magic number. Additionally, we’ve got a StopLoss variable for your stop-loss settings.The code employs a for loop to iterate through all open positions using the OrdersTotal() function. For each position, the corresponding order is selected with the OrderSelect() function. If the order is successfully selected and has the same magic number, the order’s profit is added to the Profit variable.      double ProfittoMinimo = 3; // target profit       double Profit = 0; // current profit              for(int i=0; i<OrdersTotal(); i++)         {          if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))            {             if(OrderMagicNumber() == MagicNumber) // For multiple EAs, you can remove the MagicNumber filter to manage total orders               {                Profit += OrderProfit();               }         }       }You can set the minimum profit as an external variable in the EA options:…Closing Positions When Profit is ReachedHere’s where it gets interesting! The code uses a for loop to check all open orders with the OrdersTotal() function, starting from the last order and working backward. For each order, it selects the corresponding trade with the OrderSelect() function.If the trade matches the current chart’s symbol, is of type OP_BUY, and has the same magic number, it checks if the Profit is greater than or equal to ProfittoMinimo. If it is, the trade is closed at the bid price using the OrderClose() function, and you’ll see a message confirming that the buy order has been closed.On the flip side, if it’s a sell order (type OP_SELL), and it meets the criteria, the trade is closed at the ask price, with a message displayed for the closed sell order.      for(int e = OrdersTotal() - 1; e >= 0; e--)         {          if(OrderSelect(e, SELECT_BY_POS, MODE_TRADES))            {             if(OrderSymbol() == Symbol() && OrderType() == OP_BUY && OrderMagicNumber() == MagicNumber) // Only modify the order if the MagicNumber matches               {                if(Profit >= ProfittoMinimo)                  {                   OrderClose(OrderTicket(), OrderLots(), ND(OrderClosePrice()), 3); // Bid price                   Print("Buy order closed", Profit, " - Minimum stop loss: ",MarketInfo(Symbol(), MODE_STOPLEVEL));               }           }             if(OrderSymbol() == Symbol() && OrderType() == OP_SELL && OrderMagicNumber() == MagicNumber)               {                if(Profit >= ProfittoMinimo)                  {                   OrderClose(OrderTicket(), OrderLots(), ND(OrderClosePrice()), 3); // Ask price                   Print("Sell order closed", Profit, " - Minimum stop loss: ",MarketInfo(Symbol(), MODE_STOPLEVEL));                 }           }         }         }…ConclusionThis code can be a game-changer for your position-closing strategies that focus on take profit. Plus, you can easily integrate this with a trailing stop based on your current profit. If you're running multiple Expert Advisors, consider leaving out the if condition on the MagicNumber to set universal take profit levels across all open positions. It’s a handy way to keep all your active EAs in check!

2023.10.27
Mastering the Double Bollinger Band Strategy on MT4: A Comprehensive Guide
MetaTrader4
Mastering the Double Bollinger Band Strategy on MT4: A Comprehensive Guide

1. Overview The Double Bollinger Band Strategy is a powerful tool that uses two sets of Bollinger Bands to refine your entry and exit points in the forex market. This strategy focuses on placing Buy (or Sell) trades when the price crosses above (or below) the 3σ (3 standard deviations). It also takes into account the 2σ (2 standard deviations) level of the Bollinger Bands to inform trading decisions. Default Parameters: 2σ Bollinger Bands (20, 2): This includes a simple moving average over 20 periods and 2 standard deviations. 3σ Bollinger Bands (20, 3): This also uses a 20-period simple moving average but with 3 standard deviations. Input Parameters: 2. Long Entry To open a Buy order, ensure these two conditions are met: Condition 1: The Ask price crosses above the upper 3σ Bollinger Band (BB3UP). Condition 2: If Condition 1 is true, verify that the current price is within the range of the upper 2σ Bollinger Band (BB2UP) and the lower 2σ Bollinger Band (BB2LO). 3. Sell Entry To open a Sell order, ensure these two conditions are met: Condition 1: The Bid price crosses below the lower 3σ Bollinger Band (BB3LO). Condition 2: If Condition 1 is true, ensure the current price is within the range of the lower 2σ Bollinger Band (BB2LO) and the upper 2σ Bollinger Band (BB2UP). 4. Exit Orders Utilize OCO (One Cancels Other) orders to set both stop-loss and take-profit at N pips. ※N: Set this parameter according to your strategy.

2023.10.02
Mastering the Martin Gale Breakout Strategy for MetaTrader 4
MetaTrader4
Mastering the Martin Gale Breakout Strategy for MetaTrader 4

Welcome to the world of Forex trading! Today, we're diving into the Martin Gale Breakout strategy, an Expert Advisor (EA) that many traders swear by on MetaTrader 4. This EA cleverly combines a breakout trading technique with the Martin Gale money management system to enhance your trading performance. Input Parameters: TakeProfPoints: This lets you set the Take Profit level in points for each trade, a crucial part of any trading strategy. BalancePercentageAvailable: Specify the percentage of your account balance to be allocated for trading, keeping your risk in check. TP_Percentage_of_Balance: This determines how much of your account balance is used as Take Profit for each trade. SL_Percentage_of_Balance: Set the percentage of your balance that will go towards your Stop Loss for trades—always a good safety net! Start_The_Recovery: This is key for the recovery process, controlling when and how recovery strategies kick in. TP_Points_Multiplier: A handy tool for adjusting your Take Profit points, allowing for more flexible profit-taking. MagicNumber: A unique identifier for this EA, ensuring it can manage its own trades without interference. Strategy Highlights: Breakout Trading: This EA specializes in spotting breakout opportunities in the market, where price movements break through key levels—definitely a sweet spot for traders! Dynamic Lot Sizing: Lot sizes adjust dynamically based on your account balance and risk tolerance, all while aligning with Martin Gale money management principles. Loss Recovery: This EA comes packed with a robust recovery mechanism that adapts trade parameters to help you bounce back from losses. One of the standout functions in this EA is CalcLotWithTP(), which uses three input parameters: Takeprofit, Startprice, and Endprice. It calculates the necessary volume for a trade to hit your profit goals based on where you enter and exit. Don’t worry if you’re not a coding whiz—everything in the EA’s code is thoroughly commented for easy understanding. For a deeper dive, check out my YouTube video on this strategy: Happy trading, and may your pips be plentiful!

2023.09.26
Maximize Your Trading with the Martin Gale Breakout System for MT5
MetaTrader5
Maximize Your Trading with the Martin Gale Breakout System for MT5

If you're diving into the Forex market, you might want to check out the Martin Gale Breakout system. This trading system is tailored for use with MetaTrader 5 (MT5) and cleverly combines breakout strategies with the Martin Gale money management approach to enhance your trading performance. Key Input Parameters: TakeProfPoints: Set your Take Profit level in points for each trade to lock in those gains. BalancePercentageAvailable: Decide what percentage of your account balance you want to commit to trading. TP_Percentage_of_Balance: This determines the portion of your balance that goes toward your Take Profit on each trade. SL_Percentage_of_Balance: Here, you can set how much of your balance will be used for your Stop Loss. Start_The_Recovery: This parameter is crucial for initiating recovery measures, dictating when and how they kick in. TP_Points_Multiplier: Adjust your Take Profit points with this multiplier for more flexible profit strategies. MagicNumber: A unique identifier for this system, ensuring it handles its trades independently. Why Choose This Strategy? Breakout Trading: This system excels at spotting breakout opportunities where price moves beyond critical levels. Dynamic Lot Sizing: Lot sizes automatically adjust based on your account balance and risk tolerance, in line with Martin Gale principles. Loss Recovery: Equipped with a robust recovery mechanism, this system adapts trade parameters to help recover losses when needed. The heart of this EA lies in the CalcLotWithTP() function, which takes three parameters: Takeprofit, Startprice, and Endprice. This function calculates the necessary volume for a trade to meet your profit target when entering at Startprice and exiting at Endprice. Don’t worry if you’re new to coding; everything in the code is well-commented, making it easy to understand and tweak.

2023.09.26
Understanding Symbol Filling Policies in MetaTrader 5 for Smart Trading
MetaTrader5
Understanding Symbol Filling Policies in MetaTrader 5 for Smart Trading

When trading in MetaTrader 5, understanding the symbol filling policy is crucial for making informed decisions. Let’s break down how to determine the filling policy for a financial instrument. What You Need to Know The first step is to input the symbol of the financial instrument you’re interested in. This is where the magic starts! How to Determine the Filling Policy Getting the Filling Policy Type: Using the SymbolInfoInteger function, you’ll retrieve essential information about the filling policy for your chosen symbol. This is stored in a variable, filling, as a numerical value. Comparing Filling Policies: The next step is to compare this numerical value with predefined constants that represent various filling policies. Here are a few you should know: Fill or Kill: This policy is often referred to as SYMBOL_FILLING_FOK. Immediate or Cancel: Known as SYMBOL_FILLING_IOC. Return: This is represented by SYMBOL_FILLING_RETURN. Returning the Filling Policy Type: After checking the comparisons, the function determines the filling policy type. If it matches SYMBOL_FILLING_FOK, it returns ORDER_FILLING_FOK. For SYMBOL_FILLING_IOC, it returns ORDER_FILLING_IOC. If it doesn’t match any of these, you’ll get ORDER_FILLING_RETURN. Why This Matters Understanding the filling policy helps you make better trading decisions based on the specific characteristics of the financial instrument you’re dealing with. Knowing whether you’re in a Fill or Kill situation or if you can expect an Immediate or Cancel response can significantly impact your strategy. In summary, this function in MetaTrader 5 is a key tool for retrieving the filling policy of any symbol, aiding you in navigating the trading waters with confidence!

2023.09.26
First Previous 3 4 5 6 7 8 9 10 11 12 13 Next Last