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
(10)
Proyectos
25
28%
Arbitraje
1
0% / 0%
Caducado
1
4%
Trabajando
2
Desarrollador 2
Evaluación
(5)
Proyectos
5
40%
Arbitraje
1
0% / 100%
Caducado
1
20%
Libre
Solicitudes similares
I have an indicator i will like to view in form of dashboard across various timeframes, i also will like a push notifications alert feature that will appear on my mt4 mobile to keep track of my trading pairs
Need a dashboard, which can monitor up to 30 selected pairs in selected time frames. It monitors AO, MACD and stochastic. In the cells of dashboard, if AO is positive in the relevant symbol/tf, it writes "UP". When one of AO is above 0 level AND Stochastic is in OS zone it writes "UPUP". When AO is above 0 and when stochastics is oversold minimum of two times,it will alert UPU2 if AO is negative below 0 in the
Looking for custom strength indicators I can add to my EA. An indicator that can measure the strength of buyer and sellers. Please show me what you have, thank you
Modify Indicator 30 - 40 USD
I need an expert who can assist me in modifying an open source PineScript indicator code to add additional features. Only applicants with prove of work should apply for more discussion
Hello i need an expert who can help me modify an open source PineScript indicator code to add additional features. ONLY EXPERT WITH PROVE OF WORK SHOULD CONTACT FOR FURTHER DISCUSSION ON THE PROJECT
احتاج شخص عربي يتكلم ويفهم العربية حتى يسهل شرح المطلوب للمؤشر لدي مؤشر واكسبيرت خاص بي بحاجة إلى تعديل الكود المصدري لدي والفكرة تحتاج فعم من المبرمج باختصار اريد مبرمج عربي يفهم ويتكلم العربية حتى يسهل الشرح وفي نفس الوقت صاحب خبرة وتجربة ومتداول على منصة ميتا تريدر حتى يضفي تحسينات على المؤشر ويستطيع عمل الفكرة بكل سهولة وإعطاء النصائح إذا وجد خطأ
Specification for Translating Pine Script Indicators to MQL5 Objective Translate multiple indicators written in Pine Script into MQL5. The translation should be implemented using an object-oriented and class-based approach. Additionally, the indicators should include some specific adjustments as detailed below. Requirements Object-Oriented Design Implement the indicators using an object-oriented paradigm in MQL5
Hello my friend There is a project I will send you the indicator code What is required is to issue three copies of the indicator Version 1 1, Delete the arrows and signals and keep only the red and blue lines and move them (red and blue line buffers) from the Colors section to the Settings section so that they appear as in the picture () Version 2 2, Go back to the first original cursor, move the arrows, signals, red
I have a MetaTrader 4 indicator that I programmed to give arrow signals at entry and exit. What is required, is it possible to program the indicator to be better developed so that it gives a written purchase or sale, not just shares, and also gives the phrase (adjustment zone 1 and amendment 2) when the transaction is reversed, and finally, is it possible for the indicator to change the candles so that when the
In summary 1) The bot will only take Firm Buy and Firm Sell Signals . 2) The bot will use the SL and TP based on the indicator . 3) the risk to reward is 2:1 but when the price reaches 1:1 set SL to Breakeven 4) the bot will take Firm Buy and Firm sell after the candle closes with a firm buy or firm sell 5) make sure to give an option for number of contracts to be traded . 6) Bot will close all the trades EOD

Información sobre el proyecto

Presupuesto
50+ USD
Para el ejecutor
45 USD