Display VaR per Symbol as opposed to the Entire Portfolio

MQL5 指标 专家

工作已完成

执行时间11 天
客户反馈
Was flexible and able to solve a difficult task. I appreciate his patience and hard work throughout this project :)
员工反馈
Super client

指定

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.



反馈

1
开发者 1
等级
(11)
项目
27
30%
仲裁
3
0% / 0%
逾期
1
4%
繁忙
2
开发者 2
等级
(6)
项目
6
33%
仲裁
1
0% / 100%
逾期
1
17%
已载入
相似订单
can you help me with Ctrader i need modification on the linkhttps://docs.google.com/document/d/1fggk49xWbnwahtfOlE-U7G6muZB1FT8eWmftGiY7R-s/edit?usp=sharing can you assist with cTrader modifications to enhance functionality and improve performance. do text me if you a professional on it i will be looking forward to your response best regards
MT4 Expert Advisor 30 - 120 USD
EA sittings The EA utilises the concept of grid and hedging by creating a zone for recovering losing trades It is a continues trading EA without any stop loss. The EA initially aims to trade continually without the need to hedge. The EA enter the first trade following the direction of the moving average (when price is above or below the moving average), and only hedge when, the trade goes against the trend and reach
Would I honestly need is someone who can make a profitable EA for me that can at least make me around $80 a day starting with $50 and the EA must be able to work with exness the EA should automat trades 24/7. Broker = Exness Pairs = USD/JPY XAU/USD and etc Chart time frames = M1 M15 History = last month till last 6 months. Lot size 0.10 take profit at $2 stop
Hello i am seeking a skilled MetaTrader 5 (MQL5) developer to modify an existing Telegram signal copier. The goal is to enhance the copier's functionality, reliability, and user experience. kindly bid this job to get started immediately
Hello, I’m looking for assistance with creating or customizing a TradingView indicator to suit my trading needs. If you have experience in this area, please reach out. Your help would be greatly appreciated. Thanks
# MT4 Expert Advisor Development Rules ## Time Period Definition 1. Allow user to define a specific time period (e.g., 10:00 to 15:00). 2. Identify and store the high and low prices within this period. ## Price Breakout Detection 3. Monitor current price for breakouts above the period high or below the period low. ## Signal Confirmation (signals will be taken on m5 timeframe) 4. After a breakout, wait for a signal
HI Recently purchased VPS, But now i am getting Following message "failed to get list of virtual hosts [404]", I need one help to fix this isues and make sure my EA working on VPS, when my computer off Thank you
Where are my developers colleagues . i want you to support me on existing work i just need a little addon on it. Am still a student kindly support me. You will be get paid at the end of the work. If you want more details maybe the worth of the project or any other thing let me know. THNAKS FOR THE SUPPORT
Project Description : I am looking for an experienced developer to create a multi-platform trading bot that can execute trades across Binance, Exness, MetaTrader 4/5 (MT4/MT5), and stock exchanges. The bot should implement a trading strategy that combines the Parabolic SAR and EMA 200 indicators, with automated entry and exit conditions for both long and short positions. Key features include: Integration with
Looking for EXPERIENCED DEVELOPER with a history of creating a multi- condition EA with the appropriated stops and trailing stops. I will check your order history . Backtesting without errors will be necessary to complete the order

项目信息

预算
50+ USD
开发人员
45 USD