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

Institutional Kelly-VAPS Risk Engine (Library) - MetaTrader 5용 라이브러리

Amanda V | KayruYuta
게시자:
Amanda Vitoria De Paula Pereira
조회수:
85
평가:
(1)
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The Mathematical Flaw in Retail Risk

The vast majority of algorithmic trading robots fail because they rely on static lot sizing or arbitrary percentage-based risk models, retail developers calculate risk in a vacuum, ignoring real-time market structure. When macroeconomic volatility spikes, a static stop-loss distance is mathematically guaranteed to be absorbed by standard deviation expansion.

To survive algorithmic execution, risk must be dynamic, self-adjusting, and volatility-aware.

Print


The Institutional Edge: Kelly-VAPS Architecture

The Kelly-VAPS (Volatility-Adjusted Position Sizing) Engine is a purely object-oriented C++ header file ( .mqh ) designed to be imported into professional Expert Advisors, it completely overrides standard position sizing functions by bridging two high-level quantitative models:

  • The Kelly Criterion: Calculates the mathematically optimal fraction of the portfolio to risk based on the historical win rate and payoff ratio of your strategy.

  • Volatility-Adjusted Sizing (VAPS): Normalizes the optimal Kelly risk against real-time market volatility using the Average True Range (ATR) and exact tick value constraints.


Core Architecture & Features

  • Object-Oriented Design: Clean, modular class structure ( CKellyRiskEngine ) ready to be included via #include <Institutional_VAPS.mqh> in any EA.

  • Dynamic Capital Protection: Automatically scales down exposure during erratic, high-volatility market regimes to prevent structural drawdowns.

  • Margin Safety Protocols: Built-in safeguards check free margin and broker-specific maximum/minimum volume limits before returning the final lot size.

  • Zero-Latency Math: Uses raw array pointers and memory-efficient formulas to execute complex risk calculations in nanoseconds without slowing down your OnTick execution loop.


How to Implement

  1. Place the .mqh file in your MQL5/Include folder.

  2. Call the library inside your EA and initialize the class.

  3. Pass your current win-rate, payoff ratio, and target stop-loss points to the engine. The class will return the mathematically perfect lot size tailored to the live market tick.


ExMachina CandleTimer Lite ExMachina CandleTimer Lite

ExMachina CandleTimer Lite - Free candle countdown timer for MetaTrader 5 with the ExMachina steel palette theme.

Institutional Nadaraya-Watson Kernel Regression Institutional Nadaraya-Watson Kernel Regression

A quantitative machine learning envelope that utilizes Nadaraya-Watson kernel regression math to dynamically project statistically significant mean-reversion zones without relying on traditional standard deviation.

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.