거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
Experts

Dynamic Trailing Stop Loss and Profit Target Management - MetaTrader 5용 expert

조회수:
10284
평가:
(18)
게시됨:
2023.04.27 18:03
업데이트됨:
2023.05.19 07:58
test.mq5 (3 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This code is a risk management strategy for an Expert Advisor in MetaTrader that manages existing trades based on the input parameters. It focuses on closing trades when a profit or loss threshold is reached and employs a trailing stop loss to lock in profits as the trade moves in the trader's favor.

Here is a brief explanation of the code:

  1. Necessary header files are included for trade and symbol information classes.
  2. Input parameters are defined for risk percentage, profit percentage, and trailing stop points.
  3. Global variables are declared for trade and symbol information objects.
  4. The OnInit function initializes the symbol information object and checks for errors.
  5. The OnDeinit function does nothing in this case.
  6. The OnTick function is called every time a new tick is received, and it calls the CheckTrades function.
  7. The CheckTrades function iterates through all open positions and checks if the position belongs to the current symbol. If it does, it calculates the current profit and determines whether the profit or loss thresholds have been reached. If either threshold is reached, it closes the position.
  8. If neither threshold is reached, the code checks if the position type is a buy or sell order and updates the stop loss level with a trailing stop loss. If the new stop loss level is more favorable than the current stop loss level, the position is modified with the new stop loss level.

This code provides a simple risk management strategy to manage existing trades by adjusting the stop loss level dynamically based on a trailing stop loss and closing trades when profit or loss thresholds are reached.

Expert Advisor for Opening Multiple Buy and Sell Orders Based on User Input Expert Advisor for Opening Multiple Buy and Sell Orders Based on User Input

This MT5 Expert Advisor opens multiple buy and sell orders based on user input, featuring a simple interface with Buy and Sell buttons. The EA calculates lot size, checks the spread against slippage, and places orders accordingly. It is essential to test this EA in a demo account before using it in live trading.

VPS Trailing Stop Service VPS Trailing Stop Service

VPS Trailing Stop Service

Equity and Balance as an indicator for MT5 Equity and Balance as an indicator for MT5

This is a very easy-to-use indicator that displays the changes in Equity and balance of the trading account as it dynamically moves. Particularly useful on the back tester and good for beginners to read this very easy MQL5 code.

Martingale Levels For Money Management Martingale Levels For Money Management

To use martingale money management when a position is in loss and price hits any of specific distances.