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

SetSLByLoss — set Stop Loss on all open positions by target loss amount - MetaTrader 5용 스크립트

조회수:
186
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Script that sets a Stop Loss on every open position based on a target loss amount expressed in the account's currency (e.g. $50 per position). Works for any deposit currency (USD, AUD, EUR, NZD, etc.) and any forex symbol - currency conversion is handled automatically via SYMBOL_TRADE_TICK_VALUE_LOSS. Validates broker stops/freeze levels before submitting changes, skips positions whose SL is already correct, and reports clear reasons for any positions that cannot be modified. The target loss is set in an input parameter: Maximum loss (amount in account currency) for each position.




LOGIC


  • For each open position, calculates the SL price such that if hit, the loss equals approximately InpTargetLossAmount (in the account's currency). 

  • Validates against stops level and freeze level before submitting modifications.

  • Skips positions that already have a correct SL (within 1 tick of the target).

  • Skips positions whose price has moved so far that placing the SL would violate broker constraints, logging the reason. 


TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT TickValue_Compare — diagnose differences between TICK_VALUE, LOSS and PROFIT

Diagnostic script that compares SYMBOL_TRADE_TICK_VALUE, SYMBOL_TRADE_TICK_VALUE_LOSS and SYMBOL_TRADE_TICK_VALUE_PROFIT for every symbol in Market Watch. Classifies each symbol into one of four categories (ALL_EQUAL, TV_MATCHES_PROFIT, TV_MATCHES_LOSS, ALL_DIFFER) and provides an aggregated summary plus interpretation tip. Useful for verifying which tick-value property to rely on when implementing risk-based lot sizing in EAs. Exports full per-symbol report to CSV in MQL5/Files.

Heiken ashi as series Heiken ashi as series

Heiken ashi with all buffers set as series

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.