Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Telegram üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Komut dosyaları

Lot Size Calculator - Risk Percent to Lots - MetaTrader 5 için komut dosyası

Görüntülemeler:
72
Derecelendirme:
(1)
Yayınlandı:
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

Lot Size Calculator is a script that works out the position size for a given risk and stop-loss distance. Run it on any chart, enter how much you want to risk and where the stop is, and it shows the lot size to use. It only calculates: it never opens, modifies or closes trades.

The money value of the stop distance is taken from OrderCalcProfit(), the same function the terminal uses, so the result is correct for forex, cross pairs, gold, indices and crypto, whatever the account currency. If OrderCalcProfit() is not available for a symbol, the script falls back to tick size and tick value. The lot is rounded down to the symbol's volume step and kept within the minimum and maximum volume.

Input parameters

  • Risk mode - % of balance, % of equity, or a fixed amount in account currency.
  • Risk - the percent or the amount, depending on the mode.
  • Trade direction - buy (entry at Ask) or sell (entry at Bid).
  • Stop loss distance (points) - used when the stop price is 0.
  • Stop loss price - exact stop price; 0 = use the distance in points.

Input parameters

Input parameters

Result

  • Entry and stop prices and the distance in points.
  • Risk target and the value of 1.0 lot moving to the stop.
  • Lot size, the actual risk at that lot size, and the margin required.
  • A warning when even the minimum lot risks more than the limit.

Calculation result

Result for a 1% risk buy on XAUUSD with a 200-point stop

Candle Timer and Spread Candle Timer and Spread

Shows the time left until the current candle closes and the live spread in any chart corner. Keeps counting every second, even when no ticks arrive.

Close All Positions and Orders (Filtered) Close All Positions and Orders (Filtered)

Closes open positions and deletes pending orders in one run, with filters for symbol, magic number, side and profit or loss. Asks for confirmation and retries failed closes.

Pacific Clock - US Pacific time on the chart (PST/PDT) Pacific Clock - US Pacific time on the chart (PST/PDT)

Shows US Pacific time on the chart, with the broker's time beside it, and the Pacific time of any candle under the mouse.

OrderGuard - restart-safe order sending for EAs (no duplicate trades) OrderGuard - restart-safe order sending for EAs (no duplicate trades)

An include file that makes the way an EA sends its orders safe: the same signal is never traded twice. It has no trading strategy inside and comes with a small example EA.