Display VaR per Symbol as opposed to the Entire Portfolio

MQL5 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 11 días
Comentario del Cliente
Was flexible and able to solve a difficult task. I appreciate his patience and hard work throughout this project :)
Comentario del Ejecutor
Super client

Tarea técnica

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";      // Symbol - Other
input    string      symbol2          = "XAUUSD";    // Symbol 2 - Other
input    string      symbol3          = "AUDCAD";    // Symbol 3 - Forex
input    string      symbol4          = "AUDUSD";    // Symbol 4 - Forex
input    string      symbol5          = "AUDNZD";    // Symbol 5 - Forex
input    string      symbol6          = "EURUSD";    // Symbol 6 - Forex
input    string      symbol7          = "EURGBP";    // Symbol 7 - Forex
input    string      symbol8          = "USDCHF";    // Symbol 8 - Forex
input    string      symbol9          = "USDCAD";    // Symbol 9 - Forex
input    string      symbol10          = "GBPCHF";    // Symbol 10 - Forex

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

  // Portfolio Weighting 
  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.



Han respondido

1
Desarrollador 1
Evaluación
(15)
Proyectos
34
24%
Arbitraje
3
0% / 33%
Caducado
2
6%
Trabaja
2
Desarrollador 2
Evaluación
(7)
Proyectos
7
29%
Arbitraje
3
0% / 100%
Caducado
1
14%
Libre
Solicitudes similares
Looking for an Ai EA 30 - 500 USD
I'm an experienced trader, now looking looking for an experienced MQL4/MQL5 developer with strong knowledge of AI or machine learning integration to build a highly accurate and adaptive trading EA. Requirements: Proven experience developing profitable and stable MT4/MT5 EAs Deep understanding of market structure, trend logic, and risk management Ability to integrate AI/ML models or external APIs for adaptive
I need an EA that can pass prop firm challenges and has shown good consistency over the last few years. The EA should have smooth equity curve with little drawdown. I do not want martingale or hedge EA. If you have something similar, let’s deal
We are looking for someone who can code a tradingview indicator for us, which sends alerts after criteria has been met. This indicator works on the ‘Session Volume Profile’ chart of tradingview. So for testing purposes, the coder should have access to this chart on a paid tradingview plan. This indicator should put a line or a box around the Point Of Control of the volume chart. We need a coder that understands this
Hello everyone, I’m looking for a reliable and well-tested EA that can either pass prop firm challenges (such as FTMO, MyForexFunds, etc.) or show consistent long-term performance on a funded account. Requirements: Maximum drawdown: 1–2% per trade Adjustable lot size based on account size Solid risk management with on-chart panel (daily drawdown, equity, profit target, etc.) Proper Stop Loss and Take Profit logic —
Would it be possible to get a custom offer for creating a script that would draw trendlines for multiple timeframes both top and bottom of the candles, I would like the script to monitor the chart and provide me notification when the chart touches the trendline either top or bottom. If I have a position in the chart, the notification of provide me a notification of my position during each timeframe and well as when
I have a Pine script which I have created which I want to convert to MQL5 Indicator. This is an easy job just to convert the script to MQL5. Regards Fantariz
I need a C# developer who knows the ATAS platform to build a lightweight order-flow indicator that works tick-by-tick. The logic is straightforward: • Every incoming tick compares Bid – Ask volume as well as the current bar’s OHLC differences. • The resulting value drives a simple visual cue: an arrow plotted above the bar for bullish pressure, below the bar for bearish pressure. Key requirements • Runs on both
Preferuje osóby mówiące po Polsku Potrzebuję pomocy z wkaźnikiem w Tradingview. Wskalnik obsługuje insidebary i fakinsidbar oraz daje alarmy przekazywane do Metatrader 5. W gre wchodzi przerobienie wskaźnika a nie pisanie go od nowa. I prefer people who speak Polish. I need help with an indicator in Tradingview. The indicator supports inside bars and fakinsid bars and provides alerts forwarded to Metatrader 5. This
JOB DESCRIPTION I have developed an MT5 Signal Provider Expert Advisor (EA) that scans market charts and generates buy/sell/reversal signals only — with no trade executions. The EA’s purpose is to analyze live chart data and send real-time signal alerts through MT5 notifications through external channels (e.g., Telegram, MT5 or dashboard). I’m seeking an experienced and reliable MQL5 Developer to: REVIEW DEBUG, and
Hi! I’m looking for an experienced ThinkorSwim/ThinkScript developer to implement it exactly as specified. Please read the requirements below carefully and reply with: (1) a fixed-price quote, (2) earliest start date and ETA, (3) a short summary of similar ThinkScript work you’ve done (links or screenshots if available), and (4) any questions or clarifications. Project summary Create a ThinkorSwim (ThinkScript)

Información sobre el proyecto

Presupuesto
50+ USD
Para el ejecutor
45 USD