DinexSpace Lot Size Script
- 유틸리티
-
Huu Tho Tran
DinexSpace - MetaTrader 5용 트레이딩 자동화 스튜디오.
코드를 작성하기 전에 실제 비용으로 두 단계에 걸쳐 트레이딩 아이디어를 검증합니다. 검증을 통과하지 못하면 중단하며, 로봇 비용은 받지 않습니다.
실계좌 기록
- 실계좌에서 운용 중인 금 (XAUUSD) EA 9개. Myfxbook 인증 실계좌 (프로필: DinexSpace).
- 마틴게일 없음, 그리드 없음. 각 EA의 최대 손실폭, 월평균 거래 횟수, 손절 유형을 공개합니다. - 버전: 1.0
Lot Size Script answers one question before a trade: how many lots can I open so that hitting my stop loss costs exactly the risk I chose? Drop it on a chart, fill in two numbers and read the answer.
How it works
- Risk is a percent of balance, a percent of equity, or a fixed amount in the account currency.
- The stop loss is a distance in points or a stop-loss price. A price on the wrong side of the entry is rejected with a clear message.
- The entry is the current ask (buy) or bid (sell) of the chart symbol.
- The loss for 1.00 lot at the stop is the stop distance divided by the tick size, times the symbol's tick value on the loss side. That value comes from the terminal and already includes the conversion to the account currency.
- The lot size is rounded down to the broker's lot step, so the money at risk is never above your choice.
- If the result is below the minimum lot, the script says so instead of rounding up.
- Above the maximum lot it is capped.
- The result shows the lot size, risk after rounding, stop-loss price and the margin needed (calculated by the terminal), on the chart and in the Experts log.
Inputs
Risk measured as, risk value, direction, stop loss given as, stop distance in points, stop-loss price, show result on the chart.
Limits
- The real fill price can differ from the current price used here, especially in fast markets.
- Tick value can change with exchange rates.
- The margin figure is for the current account and leverage.
The script only calculates. It never places, changes or closes orders.

