Display VaR per Symbol as opposed to the Entire Portfolio

MQL5 Indikatoren Experten

Auftrag beendet

Ausführungszeit 11 Tage
Bewertung des Kunden
Was flexible and able to solve a difficult task. I appreciate his patience and hard work throughout this project :)
Bewertung des Entwicklers
Super client

Spezifikation

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.



Bewerbungen

1
Entwickler 1
Bewertung
(10)
Projekte
25
28%
Schlichtung
2
0% / 0%
Frist nicht eingehalten
1
4%
Beschäftigt
2
Entwickler 2
Bewertung
(5)
Projekte
5
40%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
20%
Frei
Ähnliche Aufträge
Job Description: I am looking for an expert to develop a trading bot for MetaTrader 5 that will execute trades based on buy and sell signals from a custom indicator on TradingView. The indicator works on Heikin Ashi candles, and the bot should follow these detailed requirements: TradingView Alerts: Configure TradingView to send buy/sell signals via webhooks when the custom indicator prints a buy or sell signal. The
I will buy your EA for MT5, in case that on distance it is able to make a profit of 10% per month. - Martingale methods and grid strategies should not be used as the basis of a trading strategy. - Excellent win rate (>80%) - High risk/loss management - Option to select direction of trading (long, short or both) - News filter - Editable Trading Hours I will need to test in the strategy tester and on live market (on
Bonjour, Je suis à la recherche d'un développeur francophone pour une collaboration sur un projet existant à compléter ou à modifier. La base est excellente. En raison de difficultés linguistique le projet n'a pu aboutir
Brakeout expert 30+ USD
I need expert for customized time interval like from 10:10 to 14:15 ( you can change the time in inputs) after box end puts 2 pending orders 1 buy stop other sell stop above and bellow the box but you can make offset by points like +20 points from the high or low , when one of the order is filled other one is deleted and expert makes another order with desired lot size (has to be customized ) , TP levels for both
I need 1 minute candlestick data from oanda exchange to backtest the strategy. Data for all 28 currency and gold pairs. From 15 - 20 years ago. I can't find them on the internet please assist me
I have with me an EA whichs needs Optimization so that i can get the best set files which are profitble to use in my real account , EA will be provided with the timeframe and the lot size requirements also the backtesting period l
Need a EA 30 - 50 USD
I am seeking a skilled Software Developer to design, develop, and maintain applications. The ideal candidate should have a strong background in programming (Java, Python, JavaScript) and experience with web technologies and databases
I need propfirm ea which earn more than 10-15% monthly without breaching prop rules and has a max loss of 3% daily if any developer has bet for it
Hello, i need a good programmer; to code an EA to trade the most productive forex pairs (mainly 2 for the day, and 2 for the night+gold), the strategy is based on the use of one moving average and the rsi, thank you in advance
Hello, i am looking for a developer to create an EA mt5. i also need license and subscription in this software. I will provide the strategy on which the EA should be created (The EA should follow all the given strategy parameters). The EA Should have Risk Management protection like: custom lot size Custom SL, TP , Trailing SL, TP, Max DD protection (both % and USD) The EA should also display my website name and link

Projektdetails

Budget
50+ USD
Für die Entwickler
45 USD