MetaTrader Trading Tools
Showing 2414 results in this view

VR Locker Lite - Trading strategy based on a positive lock

What is locking?

Locking is a situation where a trader simultaneously holds a long (LONG) and a short (SHORT) position of equal volume on the same asset. As a result:

  • Market risk is neutralized: profit or loss on one position is offset by the opposite movement of the other.
  • The position value is "frozen": the net financial result ceases to depend on market fluctuations.

The presented VR Locker Lite trading algorithm demonstrates working with one positive lock:

Operation algorithm:

  1. The trading robot immediately opens two positions: a buy (BUY) and a sell (SELL).
  2. Using averaging, the trading robot "widens" the buy (BUY) and sell (SELL) positions.
Options for further work with the lock:
  1. The simplest one - simply close the lock and start the entire trading cycle anew.
  2. Unlock the lock - leave one of the positions for a longer period and "let the profit grow".
  3. Enable a trailing stop for one of the positions or for both simultaneously.
  4. Move one of the positions to breakeven and "let the profit grow".
  5. Start the algorithm on another financial instrument or with another MagicNumber to create another positive lock.

Important things not to forget:

  1. Double commissions and swaps: You pay a commission for opening and (in the future) closing two positions instead of one. In forex, there may be a negative swap (rollover fee) on one of the positions.
  2. Capital lock-up: The margin (collateral) for the locked position is still frozen. You cannot use these funds for other trades.
  3. Complication of analysis: You still have to decide which side of the lock to close and when. This is often more difficult than the initial entry.

Trading strategy Heads or Tails

The "Heads or Tails" trading strategy belongs to the category of high-risk short-term trading approaches, used primarily in the stock market and the Forex market. Its name is derived from the randomness of decision-making, similar to tossing a coin ("heads" — buy the asset, "tails" — sell). This strategy is based exclusively on intuitive decisions or random signals and ignores fundamental market analysis factors.

How does the strategy work?

The strategy is structured as follows:

  1. Instrument Selection: The trader chooses a financial instrument (stock, currency, commodity).
  2. Decision Making: The decision to buy or sell is made randomly, for example, by tossing a coin or using another method to choose between two possible actions.
  3. Closing the Trade: The trade is closed automatically after a predetermined time or upon reaching a specific profit or loss level.

This strategy does not require a deep understanding of market mechanisms and analytics, but it also does not imply a serious approach to risk management.

Disadvantages of the strategy:
  1. High Level of Risk:
    • Relying solely on luck significantly increases the probability of losses. The strategy ignores any objective indicators and recommendations, increasing the chances of capital loss.
  2. Lack of Risk Control:
    • Since buying or selling occurs absolutely randomly, there is no possibility for rational capital management, risk assessment, or asset allocation.
  3. Impossibility of Long-Term Success:
    • Even if individual trades are profitable due to luck, in the long term such a strategy is more likely to lead to significant losses.
  4. Short-Lived Results:
    • Positive results are only possible under favorable market conditions and with a large number of small successful trades, which is extremely rare in practice.
Application of the Strategy:

The strategy is more suitable for novice traders who want to familiarize themselves with the principles of exchange platforms and try trading without deep knowledge of technical analysis. However, professionals use this strategy extremely rarely, preferring scientifically based approaches that account for price behavior, trading volume, and companies' fundamental indicators.

For experienced investors, this strategy represents more of an experimental method for testing hypotheses, rather than a stable way to earn money.

Thus, although the strategy is simple and accessible to every beginner, it carries significant risks and practically has no chance of generating sustainable income in the long term.

Let's consider the main block of the random position opening signal:

Here, the condition for the absence of open positions is checked. Variable b denotes the number of long ("buy") positions, variable s — short ("sell") positions. If the sum of both equals zero (b + s = 0), it means there is not a single open position.

Inside the condition block triggered previously, a random number is checked. The ::MathRand() function generates a pseudo-random number from 0 to 32767 inclusive. Then this number is divided modulo by 2 (% 2) — if the remainder is 0, the next block is executed.

If the random number is even (the remainder of division by 2 equals 0), the trading robot opens a long position (buy) with a volume of iLots. After successfully opening the position, the function execution is interrupted by the return operator.

If the random number was odd (the remainder of division by 2 differed from zero), a short position (sell) with a volume of iLots is opened, and the further execution of the function is also terminated.

Final logic of the fragment:
  • The presence of the trader's open positions is checked.
  • If there are no open positions, a random trade direction is chosen: either buy (long), or sell (short).
  • An opened trade automatically stops the further operation of the function.

Thus, this code is a simple example of an algorithm that makes the decision to open a market position randomly.

MT4 Telegram Trade Notifier (Bot API) — Deal Alerts

Key Features

  • Sends alerts on executed deals (TRADE_TRANSACTION_DEAL_ADD)

  • Optional filter: BUY/SELL only

  • UTF-8 URL encoding (supports Vietnamese & emojis)

  • Optional disable web page preview

  • Simple inputs: Bot Token, Chat ID, timeout, prefix

Setup

  1. Get your target chat id (user/group) or use @channelusername.

  2. In MetaTrader 4: Tools → Options → Expert Advisors Enable “Allow WebRequest for listed URL” and add:

  3. Attach the EA to any chart and set:

    • InpBotToken

    • InpChatId

Notes / Troubleshooting

  • If WebRequest fails, check network/firewall/DNS and ensure the URL is allowed in MT4 options.

Inputs

  • InpChatId: chat id or @channelusername

  • InpSendTestOnInit: send a test message when EA starts

  • InpNotifyBuySellOnly: notify only BUY/SELL deals

  • InpTimeoutMs: WebRequest timeout

  • InpMsgPrefix: message prefix

RatioZigZag

A modification of the ZigZag indicator, where the reversal moment is determined not by a fixed percentage, but by reaching a specified ratio of the current price to the last local extremum.

RiskSizer Panel Lite MT4 - Risk Percent Lot Calculator With One Click Buy Sell

RiskSizer Panel Lite (MT4) — Risk% Lot Calculator + One-Click BUY/SELL

RiskSizer Panel Lite is a lightweight MT4 trading panel that helps you calculate an estimated lot size from a fixed risk percentage of your account balance, using two draggable horizontal lines on the chart as your SL/TP zone. It also includes one-click BUY/SELL execution for fast manual trading.

Key Features
  • Risk-based lot sizing by % of Account Balance.
  • Two draggable chart lines (LOW / HIGH) to define your SL and TP levels quickly.
  • One-click trading: BUY / SELL.
  • Editable Risk%:
    • Click the Risk% box and type your value
    • Enter = Apply, Esc = Cancel
    • Use + and - buttons for quick adjustment (step size configurable)
  • Live preview on the panel:
    • Symbol
    • Spread (points)
    • Risk money (account currency)
    • Calculated BUY lot / SELL lot
    • LOW/HIGH line prices
  • Reset button to restore default SL/TP line distances around current price.
  • Optional Max Spread filter to block trades when spread is too high.
How It Works
  • The panel uses two horizontal lines on the chart:
    • LOW line = lower price line
    • HIGH line = higher price line
  • BUY logic: Entry = Ask, SL = LOW line, TP = HIGH line (only if HIGH > Ask)
  • SELL logic: Entry = Bid, SL = HIGH line, TP = LOW line (only if LOW < Bid)
Inputs / Parameters
  • Risk % per trade (InpRiskPercent)
  • Risk step (InpRiskStep)
  • Default SL points (InpDefaultSL_Points)
  • Default TP points (InpDefaultTP_Points)
  • Max spread (points) (InpMaxSpread_Points) — 0 disables the filter
  • Deviation (points) (InpDeviation_Points)
  • Magic number (InpMagic)
  • UI refresh (ms) (InpUiRefreshMs)
Notes
  • This is a Lite tool designed for simplicity and fast manual execution.
  • Risk is calculated from Account Balance (not Equity).
  • Lot sizing engine is intentionally simplified (approximate calculation for universal symbols).
  • Please test on a demo account before using on real accounts.

    If you find this utility helpful, feel free to leave feedback and suggestions.

    MaEnv_02B

    Optimistic trader may enter the market when the price crosses the aqua line.

    More reliable entry will be when the price crosses the blue line.

    When the price comes back and crosses the red line you can open a position in the course of price movements.

    This indicator designed for EURUSD, M5.

    Optimize single Moving average trading

    This code is following the idea of MA Profit, except that it is using a single Moving Average instead of the cross moving average system.

    Using only a single moving average speeds up optimization, it can check all moving averages between 10 and 1000 in nearly no time.

    Trading with single moving average gives three signals. Usually it works with large moving averages like 150 or even 500 or more.

    1. The curve is below the candles - buy
    2. The curve is above the candles - sell
    3. the curve is horizontal and many times crossing the candles - close positions and wait

    By switching the period everything is re-calculated, you can check if different time frames (minute, hour, day and so on) show the same signal. Usually a signal is stronger if displayed by by multiple time frames. Also you can switch to lower time frame in order to find an entry point into a long or short trade.

    The indicator draws 4 kinds of triangles

    The indicator dispays the status and the number for good and wrong signals in its status line.

    The optimization can be in two modes:

    1. Simulated trading. The best moving average is the one which gave the best profit
    2. Counting intersections between candles. The less time the curve and the candles hit each other the better the moving average is.

    Parameters: (look source code also)

    extern bool bOptimize=true; // True: Find the best single MA by optimizing (switch time frame to re-optimize) extern bool bOptimizeIntersect=true; // True: optimize for minimum intersections, otherwise optimize for max profit extern int PeriodMA=400; // If you do not want to optimize, you can define a period extern int Method=0; // Method for MA 0 = Simple, 1 = Expotential, 2 = Smoothed, 3 = Linear weighted extern bool DrawTringles=true; // Draws triangles for the simulated trading extern int MinMA=5; // Minimum test for optimizing extern int MaxMA=500; // Maximum test for optimizing extern int StepMA=1; // Step during optimizion, 1 tests every MA, 10 tests every 10th etc. extern int CountOptimize=300; // Number of candles for optimizing extern int RepaintBars=3000; // Number of candles on which we draw triangles and calculate the win/loss extern bool Alarm=true; // Make a visible alert on new signal extern bool bSpeak=true; // Speak the alert with gspeak

    Moving average trading gives some very good signal but also a lot of false signals. I am currently seeking more ideas of filtering the false signal in order to publish my moving average expert advisor.

    Plese use at your own risk!

    EA_PSar_002B_v1

    EA tested and optimized on FXDD’s MT4 trading platforms.

      RSI-MA

      Better to use on the Daily TF.

      You may change extern parameter "RSIPeriod" to fit each and every Symbol and TF.

      EA_RSI_MA

      Description:

      This EA is based on the indicator . EA designed for EURUSD, D1.

      Testing results:

      Symbol EURUSD (Euro vs. United States Dollar)

      Period: Daily (D1) 2010.01.04 00:00 - 2010.09.24 00:00 (2010.01.02 - 2010.09.25) Model: Every tick (the most precise method based on all available least timeframes) Bars in test: 1191 Ticks modelled: 1694427 Modelling quality: 90.00% Mismatched charts errors: 59 Initial deposit: 10000.00 Total net profit: 1991.46 Gross profit: 2992.70 Gross loss: -1001.24 Profit factor: 2.99 Expected payoff:132.76 Absolute drawdown:218.14 Maximal drawdown:782.92 (7.28%) Relative drawdown: 7.28% (782.92) Total trades:15 Short positions (won %) 7 (57.14%) Long positions (won %) 8 (25.00%) Profit trades (% of total) 6 (40.00%) Loss trades (% of total) : 9 (60.00%) Largest profit trade 999.00 loss trade -203.84 Average profit trade 498.78 loss trade -111.25 Maximum consecutive wins (profit in money) 3 (1692.11) consecutive losses (loss in money) 3 (-313.12) Maximal consecutive profit (count of wins) 1692.11 (3) consecutive loss (count of losses) -331.84 (2) Average consecutive wins 2 consecutive losses 2

      BandsFilter

      Автор:

      Автором данного индикатора является Яковлев (Ильюхин), моя модернизация.

      Описание:

      Используется индикатор Яковлева (Ильюхина), который реализовал идеи Кравчука, но в более приемлемом виде: в отличие от FAТLов и SATLов, которых полно в сети, данный индикатор позволяет задавать параметры фильтров. Описание здесь . Сами индикаторы здесь . Обращаю внимание, что для работы индикатора необходима установка библиотек. Все описано по указнной ссылке, повторять не буду.

      Использование индикатора аналогично тем индикаторам, которые лежат в основе предлагаемого: фильтра (центральная линия), полосы Боллинджера. Ширина полос является параметром. Параметр Deviation позволяет выделять флэты в виде прямых горизонтальных линий. Величина Deviation в пипсах отклонения индикатора, а не цены.

      Картинка:

      Пунктиром показан ВВ с аналогичными параметрами (Период=14, СКО = 1)

      Moving Average Mirror

      Description:

      Forex trading will becoming more simple & profitable with this indicator.

      Entry BUY after Red Line crossing up the Blue Line and exit before the Red Line crossing down the Blue Line.

      Opposite position : entry SELL after Red Line crossing down the Blue Line.

      Image: