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

Simple continuous trend-following strategy for buying and selling based on predefined conditions - MetaTrader 4용 expert

[삭제]
조회수:
2736
평가:
(1)
게시됨:
2024.04.09 15:49
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동


This MetaTrader 4 (MT4) script implements a simple continuous trend-following strategy for buying and selling based on predefined conditions. Here's a breakdown of the script:

  1. Initialization: The script initializes and prints a message when initialized successfully.

  2. Deinitialization: The script deinitializes and prints a message when deinitialized.

  3. OnTick Function: This function executes whenever there's a new tick (price change) in the market.

    a. Reset Position Tracking Variables: The script resets variables tracking open buy and sell positions.

    b. Check Open Orders: It loops through all open orders to determine if there are any existing buy or sell positions.

    c. Open Buy Position: If there's no open buy position and the "OpenBuyPosition" flag is set to true, it attempts to open one based on the current market bid price. It sets a stop loss and take profit for the buy order.

    d. Open Sell Position: If there's no open sell position and the "OpenSellPosition" flag is set to true, it attempts to open one based on the current market ask price. It sets a stop loss and take profit for the sell order.

    e. Check Closed Orders: It checks for any closed orders. If a buy or sell order is closed with profit, it resets the corresponding position flag.

  4. Input Parameters: The script provides input parameters for lot size, stop loss, take profit, and flags to control whether to open buy or sell positions.

  5. Disclaimer: The script includes a warning advising users to use it at their own risk and absolves the creator from any responsibility for potential damage or loss.

Overall, this script aims to automate the process of executing buy and sell orders based on a continuous trend-following strategy, allowing users to customize parameters such as lot size and trade direction. However, users should exercise caution and conduct thorough testing before deploying it in live trading environments.


Calculate pip difference over the last N bars Calculate pip difference over the last N bars

Bars Pips for Chart Symbol and Period selected

Harmonized Pending Hedge of open trades for chart symbol Harmonized Pending Hedge of open trades for chart symbol

Hedge Symbol 100%

Trailing_StopLoss_for All_orders_and_symbols Trailing_StopLoss_for All_orders_and_symbols

Trailing_StopLoss_for All_orders_and_symbols

Reverse Trades For All Symbols Script Reverse Trades For All Symbols Script

Reverses all open trades after Closure for all symbols .