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

Close_on_PROFIT_or_LOSS_inAccont_Currency - MetaTrader 4용 expert

[삭제]
조회수:
3707
평가:
(2)
게시됨:
2024.03.24 18:17
업데이트됨:
2024.04.07 20:20
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

//+------------------------------------------------------------------------------------------------------------------------------+

//|Close_on_PROFIT_or_LOSS_inAccont_Currency_V2 optimization: what's new:

//|

//|1. Added Error Handling: The code includes error handling to deal with situations where orders cannot be closed or deleted.

//|2. Code Optimization: The code is optimized to avoid repetition and improve readability.

//|3. Efficiency: Removed unnecessary loops or computations.

//|4. Clear all chart objects upon EA deinitialization

//+------------------------------------------------------------------------------------------------------------------------------+



At 0 set EA will do nothing.   

Positive_Closure_in_Account_Currency must be higher than the current Equity amount, otherwise, the trades will be executed immediately.

Example: Equity is 55000$ and Positive_Closure_in_Account_Currency set to 55500$ to gain 500$

Positive_Closure_in_Account_Currency  > O && <  55000$ = immediate execution


Negative_Closure_in_Account_Currency must be lower than the current Equity amount, otherwise, the trades will be executed immediately.

Example: Equity is 55000$ and Negative_Closure_in_Account_Currency set to 54500$ to loose only 500$ 

Negative_Closure_in_Account_Currency  >55000$ = immediate execution


Spread spikes can be avoided by reducing the spread number but the market will do what it wants and higher gains or losses can occure. 

Also if the spread is set lower than the average spread for the pairs traded those positions will not be executed. 

WARNING: Use this software at your own risk. The Forex market is very volatile! 

#property copyright     "Copyright 2024, MetaQuotes Ltd."

#property link          "https://www.mql5.com"

#property version       "1.01"

#property description   "persinaru@gmail.com"

#property description   "IP 2024 - free open source"

#property description   "This EA closes all trades on Profit and Losses calculated in Account Currency."

#property description   ""

#property description   "WARNING: Use this software at your own risk."

#property description   "The creator of this script cannot be held responsible for any damage or loss."

#property description   ""

#property strict

#property show_inputs

extern string  Closures = "EA closes all trades and pending orders when a profit or loss is reached. Profit and Losses are calculated in Account Currency."; 



extern int Positive_Closure_in_Account_Currency     = 0; 

extern int Negative_Closure_in_Account_Currency     = 0; 


extern int Spread = 10;


    Hedge_Dollar_Index_Against_Forex_Pairs_V1 Hedge_Dollar_Index_Against_Forex_Pairs_V1

    Hedge Dollar index USIDX against its constitutive FOREX pairs EURUSD GBPUSD USDJPY USDCAD USDSEK USDCHF

    Error_Break_Script_V2  - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy Error_Break_Script_V2 - This script is a general example of using error brake in any strategy - Break on Code Error Sample Strategy

    Break on Code Error ! This script is a general example of using error brake in any strategy.