Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

VR Locker Lite - Trading strategy based on a positive lock - expert for MetaTrader 5

Views:
186
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

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.

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/68602

EA Duplicate Detector EA Duplicate Detector

Allow the EA to determine whether there are duplicate EAs on the chart based on conditions.

Project Template Generator Project Template Generator

This script serves as a practical example of how developers can programmatically work with files using MQL5. One of its key objectives is to demonstrate effective project file organization, which is essential for developers working on large-scale systems or aiming to create portable, self-contained projects. The concept can be expanded further and refined with additional ideas to support more advanced development workflows.

Binary tradng based on candle colors Binary tradng based on candle colors

A simple binary trading strategy that counts candle colors.

Сode that records balance and equity charts and calculates additional optimization criteria Сode that records balance and equity charts and calculates additional optimization criteria

If you have access to the Expert Advisor code, you can save balance and equity charts and calculate additional optimization criteria by adding additional code from this library.