거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
110
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Before every trade, a trader has to answer one question: how many lots can I open so that a stop loss hit costs exactly the risk I chose? This script answers it in one click. Drop it on any chart, enter your risk in percent and your stop distance in points, and it shows the lot size to trade together with the real money at risk after rounding.


Many lot calculators rely on the tick value alone. On some brokers this is wrong for gold, indices, stocks and cross pairs, because of the contract size, the profit currency or the way the broker reports tick values. This script does not guess: it asks the terminal how much a 1.0 lot buy would lose over your stop distance, using the built-in OrderCalcProfit() function. The broker's own rules for contract size, tick value and currency conversion are therefore applied automatically.


The lot size is always rounded down to the broker's volume step, so the trade never risks more than you asked for. The script then shows the actual risk of the rounded lot, in money and in percent. If even the minimum lot is too big for your risk, it does not suggest a trade: it tells you how much the minimum lot would actually risk, so you can decide yourself.

The result appears in an alert window, in the Experts log and in the top-left corner of the chart:


First line: the symbol, your risk in percent and in account currency, and the stop distance in points.

Second line, "Lot size": the lot to trade, followed by the actual risk of that lot after rounding.

Second line, "Too small": your risk is below what the minimum lot needs; the line shows the risk of the minimum lot instead.


Input parameters:


The stop distance is entered in points, the smallest price step of the symbol, so one input works on every market. On a 5-digit EURUSD quote, 10 points are 1 pip. On a 2-digit gold quote, 100 points are 1.00 USD per ounce, so 500 points are a 5.00 USD stop. On a 3-digit gold quote, the same 5.00 USD stop is 5000 points.


Example: on a 10,000 USD account, XAUUSD quoted with 2 digits, 1% risk and a 500 point stop, one lot of 100 ounces loses 500 USD, so the script shows 0.20 lots with an actual risk of 100 USD. Run the script while the market is open, so the symbol has a current price. The two helper functions, LossPerLot() and RoundLots(), are short and commented and can be reused in your own Expert Advisors.

Input Default Description
RiskPercent 1.0 Risk per trade, in percent of the balance or the equity
StopPoints 500 Stop loss distance in points (the symbol's smallest price step)
UseEquity false true: percent of equity; false: percent of balance


Same H4 and D1 candles on every broker - NY close candles from H1 Same H4 and D1 candles on every broker - NY close candles from H1

Builds H2 to D1 candles from H1 on the New York close clock, so your indicators see the same candles on every broker, no matter which server time it uses. Detects the server clock automatically.

Can I trade right now - session, session end and quote check in one call Can I trade right now - session, session end and quote check in one call

One call before you send an order: is the session open, how long until it closes, are quotes still coming in, is trading allowed. Gives you the reason when the answer is no.

Robustness Lab: Seasonality heatmap with t-statistics (hour x weekday) Robustness Lab: Seasonality heatmap with t-statistics (hour x weekday)

Shows how a symbol has behaved in every hour of every weekday, as a heatmap on the chart. Colour the cells by t-statistic, mean return, hit rate or average range. Cells that pass a significance threshold get a gold frame, and the panel tells you how many cells would pass that threshold by chance alone, so a single lucky hour is not mistaken for an edge. Hover any cell for its full numbers. Part of the free Robustness Lab set.

Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility) Robustness Lab: Market regime indicator (bias-corrected Hurst, efficiency ratio, volatility)

Classifies the market as trend, mean-reversion or noise using three public measures: the Hurst exponent by rescaled range with small-sample bias correction, Kaufman's efficiency ratio and the percentile of the current ATR. A colour strip shows the regime bar by bar, and a panel shows the regime on M15, H1, H4 and D1 at the same time. Part of the free Robustness Lab set.