The code that has been provided calculates the value at risk for the entire portfolio (opened trades on MT5). I would like to understand what this comprises of on a per Symbol basis.
1) Calculate the Value at Risk for Each of the 10 Symbols (for Buy & Sells) and then for the Whole Symbol:
Line 51 of Account Manager Part 1:
input string CHART_MANAGEMNET1= "====== CHART MANAGEMENT ======";
input string symbol1 = "US30";
input string symbol2 = "XAUUSD";
input string symbol3 = "AUDCAD";
input string symbol4 = "AUDUSD";
input string symbol5 = "AUDNZD";
input string symbol6 = "EURUSD";
input string symbol7 = "EURGBP";
input string symbol8 = "USDCHF";
input string symbol9 = "USDCAD";
input string symbol10 = "GBPCHF";
Suggested Process:
//Calculate the Value at Risk for Buy & Sell Side - Note Repeat Process fro Symbols 2 - 10
/*
double ValueAtRiskB1
double ValueAtRiskS1
//Used to Calculate the Total Value at Risk of the Symbol - Note Repeat the Process for Symbols 2 - 10
if((ValueAtRiskB1 - ValueAtRiskS1) > 0)
{
double ValueAtRisk1 = (ValueAtRiskB1 - ValueAtRiskS1)
}
else
{
double ValueAtRisk1 = (ValueAtRiskB1 - ValueAtRiskS1)*-1
}
2) Show the Relevant Weightings of the Currently Open Trades (in terms of Value at Risk):
Divide the current Value at Risk of the Symbol by the Total Value at Risk & Convert to a Percentage
Line 173 of Account Manager Part 1
double Weighting1 = ValueAtRisk1/currValueAtRisk
double Weighting2 = ValueAtRisk2/currValueAtRisk
double Weighting3 = ValueAtRisk3/currValueAtRisk
double Weighting4 = ValueAtRisk4/currValueAtRisk
double Weighting5 = ValueAtRisk5/currValueAtRisk
double Weighting6 = ValueAtRisk6/currValueAtRisk
double Weighting7 = ValueAtRisk7/currValueAtRisk
double Weighting8 = ValueAtRisk8/currValueAtRisk
double Weighting9 = ValueAtRisk9/currValueAtRisk
double Weighting10 = ValueAtRisk10/currValueAtRisk
3) Display Information in Dashboard:
Comment(
" RISK MANAGEMENT: ", "\n\n",
"Symbol 1: VaR: " + DoubleToString(ValueAtRisk1, 2) + "Weighting:" + DoubleToString(Weighting1, 2) + "\n\n",
"Symbol 2: VaR: " + DoubleToString(ValueAtRisk2, 2) + "Weighting:" + DoubleToString(Weighting2, 2) + "\n\n",
"Symbol 3: VaR: " + DoubleToString(ValueAtRisk3, 2) + "Weighting:" + DoubleToString(Weighting3, 2) + "\n\n",
"Symbol 4: VaR: " + DoubleToString(ValueAtRisk4, 2) + "Weighting:" + DoubleToString(Weighting4, 2) + "\n\n",
"Symbol 5: VaR: " + DoubleToString(ValueAtRisk5, 2) + "Weighting:" + DoubleToString(Weighting5, 2) + "\n\n",
"Symbol 6: VaR: " + DoubleToString(ValueAtRisk6, 2) + "Weighting:" + DoubleToString(Weighting6, 2) + "\n\n",
"Symbol 7: VaR: " + DoubleToString(ValueAtRisk7, 2) + "Weighting:" + DoubleToString(Weighting7, 2) + "\n\n",
"Symbol 8: VaR: " + DoubleToString(ValueAtRisk8, 2) + "Weighting:" + DoubleToString(Weighting8, 2) + "\n\n",
"Symbol 9: VaR: " + DoubleToString(ValueAtRisk9, 2) + "Weighting:" + DoubleToString(Weighting9, 2) + "\n\n",
"Symbol 10: VaR: " + DoubleToString(ValueAtRisk10, 2) + "Weighting:" + DoubleToString(Weighting10, 2) + "\n\n",
"Total Value at Risk: $" + DoubleToString(currValueAtRisk, 2) + "\n\n",
"Standard Deviation: " + DoubleToString(currportfolioStdDev, 6) + "\n\n"
);
Note: Account Manager Part 2 - will likely need to be adapted. To fetch values from it make these values a double in the following code (this worked beforehand).
class CPortfolioRiskMan
{
public:
double portfolioStdDev;
double MultiPositionVaR;
Make sure to add the MPH file in the includes folder for decompiling.
Solicitudes similares
Account size 50$ to 100$ or 5000USC to 10000USC ( Account $ Size may not matter ) Max Leverage 1000-2000 Min Lot 0.01 [ if averaging possible ] Averaging + Shift TP Faster Required if Trend Direction is Clear Account Protection Maxx Profit Max Loss Key Based Activation News Filter Need Expert to handle this to avoid false entry [ Developer can suggest extra additional filters inputs here ] as i mentioned I have no
Build a Forex Multi-Basket Trading Bot for OANDA (Python v20 REST API Only) MANDATORY DEVELOPER REQUIREMENTS (PLEASE READ BEFORE APPLYING): Do not apply for this project unless you meet the following strict professional criteria: 1. Deep Mathematical & Quantitative Background: You must thoroughly understand statistical distributions, rolling standard deviations (σ), calculating matrix medians, and dynamic Z-score
I need a complete MetaTrader 5 Expert Advisor built for XAUUSD. The EA will trade a multi-timeframe trend-pullback strategy using the Daily, H4, and M15 timeframes. It must generate signals, manage trades, send alerts, and come with a full backtest on gold. This is a technical build. I am not asking for guaranteed profits or financial advice. Platform and Market Platform: MetaTrader 5 Language: MQL5 Symbol: XAUUSD
I need an AI based mt5 EA which self learns and improves on its previous mistakes. The EA must be able to utilize numerous trade set ups like; 1. CRT, 2. liquidity sweep reversal at selected higher timeframe where a candle sweeps previous candle high and closes lower or sweeps previous candle low and closes higher, 3. SMC where it trades on OB, CHoCH, BOS. 4. Support and resistance. It should trade any currency pair
i need some tradingview strategy that i want to use as a tester, i have something that i am working on currently and i need someone that can provide me with tradingview strategies that doesn't have a win rate, the one with 1:1 RR it need to have low win rate like 10% or 5% profitability, i am not paying $30 for,i dont have up to that for this cause i only want to use it as a test, if anyone have any to send me please
hello i need help building a ea bot for mt5 and i have started on claude but i will need someone if a incredible experience to make my ideas come to live. please contact so we can schedule a quick call and i can share anything that concerns you for the task
I am looking for someone with real experience developing strategies, indicators, or trading tools for Quantower . The strategy itself is relatively simple. The main issue is that I need to use some of Quantower's functions and API capabilities to program the strategy, but there is limited documentation available for some of the functionality, and I do not have enough time to fully understand the API and implement
I am looking for an experienced MQL5 developer who can BOTH research trading strategies and develop a commercial-quality MetaTrader 5 Expert Advisor. This is NOT simply a coding job. The developer is free to choose the trading logic, indicators, entry method, exit method, timeframe architecture and strategy type. I do not require the EA to copy or resemble any existing commercial EA. My priority is: ROBUST LONG-TERM
A developer will create an AI assisted EA forex watch-list scanner (not an auto-trader) designed to surface PDL/PDH bounces on M15, with coding in Python/MQL5. This will strictly be a market intelligence and scanning tool (no automatic order placement) and EA primary function will be a delivery of visual dashboard UI, 2-phased alerts (warning vs. execution), and multi-channel notification. 1. Project Overview &
Hello, please make me a simple MT5 Expert Advisor for XAUUSD on M15 timeframe. TRADING LOGIC: - BUY when EMA(10) crosses UP EMA(30) - SELL when EMA(10) crosses DOWN EMA(30) TRADING HOURS: - Only trade between 19:00 - 22:00 WIB / Jakarta time RISK SETTINGS: - Lot size: 0.01 - Stop Loss: 70 points - Take Profit: 150 - 300 points - Max 1 open position Please deliver .ex5 file ready to use. Thank you