Adding of Proposed vs Current Value at Risk Filter

MQL5 Indicators Experts

Job finished

Execution time 10 hours

Specification

Context: Watch the following video for an example usecase - https://www.youtube.com/watch?v=3FV8PTikKc0


What I have at the moment is an Expert Advisor that calculates the Total Value at Risk for Currently Open Symbols.

Outcome, a bool (true / false) variable that checks the symbol , lot size and assesses whether adding that trade would reduce the value at risk.

e.g. if Proposed Value at Risk < Current Value at risk then the variable is true.

Here is my attempt at this:

bool LowerVAR(string Symbol1, double Lotsize1)
{
    //string CurrPortAssets[]   = {symb1, symb2, symb3, symb4, symb5, symb6, symb7, symb8, symb9, symb10};
    //double CurrPortLotSizes[] = { SumLots(symb1), SumLots(symb2), SumLots(symb3), SumLots(symb4), SumLots(symb5), SumLots(symb6), SumLots(symb7), SumLots(symb8), SumLots(symb9), SumLots(symb10)};      
   string CurrPortAssets[];
   double CurrPortLotSizes[];
    
    CPortfolioRiskMan PortfolioRisk(InpVaRTimeframe, InpStdDevPeriods, InpCorrelPeriods);

    PortfolioRisk.CalculateIncrementalVaR(CurrPortAssets, CurrPortLotSizes);

    // CREATE PROPOSED POSITION ARRAY AND ADD PROPOSED POSITION
    string ProposedPortAssets[];
    double ProposedPorLotSizes[];
    ArrayResize(ProposedPortAssets, ArraySize(CurrPortAssets) + 1);
    ArrayResize(ProposedPorLotSizes, ArraySize(CurrPortLotSizes) + 1);

    ArrayCopy(ProposedPortAssets, CurrPortAssets);
    ArrayCopy(ProposedPorLotSizes, CurrPortLotSizes);

    ProposedPortAssets[ArraySize(ProposedPortAssets) - 1] = Symbol1;
    ProposedPorLotSizes[ArraySize(ProposedPorLotSizes) - 1] = Lotsize1;

    // POSITION DIAGNOSTICS
    string posDiagnostics = "";
    for (int i = 0; i < ArraySize(ProposedPortAssets); i++)
    {
        string posType = (i == ArraySize(ProposedPortAssets) - 1) ? "PROPOSED" : "EXISTING";
        posDiagnostics += "Pos " + IntegerToString(i) + " " + ProposedPortAssets[i] + " " + DoubleToString(ProposedPorLotSizes[i], 2) + "  (" + posType + ")\n";
    }

    // CALCULATE THE PROPOSED VaR IF NEW POSITION WERE ALLOWED TO OPEN
    PortfolioRisk.CalculateIncrementalVaR(ProposedPortAssets, ProposedPorLotSizes);
    double proposedValueAtRisk = PortfolioRisk.IncrementalVaR;

    return TotalValueAtRisk > proposedValueAtRisk;
}


What I need next is some assistance in editing / making a change to this so that I can achieve the above goal above.

Please check all the content and I will send you the code (which I have already created), I just need to make sure you understand he task.


Looking forward to working with you :)


Responded

1
Developer 1
Rating
(206)
Projects
336
16%
Arbitration
23
39% / 30%
Overdue
18
5%
Busy
2
Developer 2
Rating
(9)
Projects
20
10%
Arbitration
3
67% / 33%
Overdue
5
25%
Free
3
Developer 3
Rating
(8)
Projects
18
17%
Arbitration
3
67% / 0%
Overdue
0
Free
Similar orders
I need to add an alert to my SMC Order Blocks indicator. This is a custom indicator that was made for me some time ago. This custom indicator already has built-in alerts, but I need to add another type of alert, keeping the existing alerts unchanged. The alert will be for a specific Order Blocks pattern. This indicator graphically provides a zigzag, from which CHoCH and BOS are derived with their respective zones of
Hello programmers, I’m looking only for veteran programmers with profound knowledge and experience in strategy optimization to improve my EA. The backtests are incredible, even with REAL TICKS of 100% quality Dukascopy data, but real results are quite disappointing on my specific brokerage. I would really love to adapt the EA so that back testing results and forward testing can better match. The strategy uses a
I'm looking for someone who can convert a pinescript from trading view to MQL5. The task requires knowledge of MQL5 coding standards and the ability to translate logic from the original script accurately
I want like to convert my tradingview indicator to mt4 EA I use 3 MA MSB RSI The list of the 4 indicators are on TradingView, 1. Market Structure Break And Order block. By EmreKb 2. TMA - Divergence Indicator (V2) 3. Multiple MA (21,50,100) 4. SuperTrend
Project Overview: I would like you to develop a Moving Average Crossover Trading Bot for MetaTrader 5 (MT5), compatible with all trading instruments (Forex, Stocks, Indices, Commodities, etc.), that incorporates machine learning algorithms to improve the strategy’s performance. The bot should be customizable, allowing users to adjust various parameters such as risk percentage, moving average periods, stop loss, take
Expert advisor in mql5 50 - 130 USD
Hi, I need an expert advisor for forex multi currency and multi timeframe that ea would give one percent profit from all trades. After profit that ea will close all orders. Regards
Hope so, you are fine and in good health I would like to invite you for the work, I have one indicator that is written in pine script (Tradingview) language, I would like it to be converted to Mql5, that will further lead in making of trading bot according to condition I will share with you Following, the indicator file is already attached, kindly look into it and if you can , I would be happy to work with you
Hello Developers, I'm looking for someone who has had past success and is familiar with the above concepts—something similar to the popular LuxAlgo SMC indicator on Tradingview. The objective is to develop the indicator to create an expert adviser that incorporates the above. Dedication to help achieve this project is what I'm looking for. If you're someone who will go above and beyond for the client and is willing
Hi I need MT5 Indicator with these features (all in one); details will be sent later. Short Explanation for all features : 1. Gap notification : show and alert when theres gap between two closed candlestick 2. Candle Body : show and alert specific candle body size 3. Candle Upper Wick : show and alert specific candle upper wick size 4. Candle Lower Wick : show and alert specific candle lower wick size 5. Consecutive
Hello! Since last coder never finished I need to post again, please only accept if you can deliver this conversion. I want to convert an existing open source indicator for tradingview to mql5. Its an orderblock indicator also showing horizontal bullish/bearish volume. My expectation of this is the following: The orderblocks will apear on the chart at exactly the same place with top/bottom etc. The bullish and bearish

Project information

Budget
85+ USD
For the developer
76.5 USD
Deadline
to 2 day(s)