Adding of Proposed vs Current Value at Risk Filter

MQL5 Indicadores Asesores Expertos

Trabajo finalizado

Plazo de ejecución 10 horas

Tarea técnica

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 :)


Han respondido

1
Desarrollador 1
Evaluación
(329)
Proyectos
515
19%
Arbitraje
35
46% / 31%
Caducado
34
7%
Trabaja
2
Desarrollador 2
Evaluación
(9)
Proyectos
20
10%
Arbitraje
4
50% / 50%
Caducado
5
25%
Libre
3
Desarrollador 3
Evaluación
(9)
Proyectos
19
16%
Arbitraje
3
67% / 0%
Caducado
0
Libre
Solicitudes similares
I am commissioning the development and reverse-engineering of a commercial-grade, multi-strategy quantitative trading portfolio modeled on proven institutional frameworks (Reference methodology: https://whop.com/the-agent-algo/products/ ). The goal is to develop a standalone, fully owned commercial trading system covering Nasdaq (NQ) and Gold (XAUUSD) with an integrated licensing engine ready for commercial
Hello, I already have an MT5 Expert Advisor for XAUUSD based on Fibonacci, market structure, BOS/CHoCH and swing trading. I need an experienced MQL5 developer to modify my existing EA, not develop a completely new one. Required modifications: Partial take-profit system with multiple TP levels. Keep profit targets conservative, using Fibonacci extension levels. Stop-loss placement beyond liquidity areas, not exactly
Exir AI 30 - 200 USD
I need an experienced MQL5 developer to build a custom AI-assisted Expert Advisor (EA) for MetaTrader 5. The EA will run on a live MT5 account with Tickmill and must support Forex and Crypto CFDs. Required instruments: - EURUSD - GBPUSD - USDJPY - XAUUSD - BTCUSD - ETHUSD Required timeframes: - M5, M15, and M30 Trading logic: - M30 determines the overall trend. - M15 identifies entry zones, support/resistance, and
Hello, I am an independent developer selling an Expert Advisor (EA) on the MQL5 Market. I am looking for an experienced Forex affiliate marketing company or professional marketer to promote my existing MT5 trading robot to customers worldwide. My proposed partnership offers a 35% commission per verified sale, with the possibility of a long-term collaboration. I would like to know: Do you promote third-party MT5
I am a serious trader looking to acquire an existing, stable, and consistently profitable Expert Advisor (EA) specifically designed primarily for Gold (XAUUSD). This is an outright purchase. I am not interested in developing a new EA from scratch. I am only interested in ready-to-use systems with a genuine, verifiable track record of performance
I am a serious buyer looking to acquire an existing, stable, and consistently profitable Expert Advisor (EA) specifically designed primarily for Gold (XAUUSD). This is an outright purchase. I am not interested in developing a new EA from scratch. I am only interested in ready-to-use systems with a genuine, verifiable track record of performance. ✅ EA Requirements Mandatory Demo Testing on DuraMarket Testing on a
USD54 Applications The bot should open trades when the price breaks out of the band by a specified percentage, for example, 0.10%. If the price breaks above the band, the bot should open a long position. If the price breaks below the band, it should open a short position. The bot should also open trades when the price touches a band: Bullish band cross: When a bullish cross occurs between the bands, the bot should
#property strict #property version "1.00" #property description "EMA Trend + Pullback + Engulfing EA" // Include the standard MT5 trade library. #include <Trade/Trade.mqh> CTrade trade; //============================================================== // INPUT SETTINGS //============================================================== // Trend indicators input int FastEMA = 20; input int SlowEMA = 50; // Pullback
Title: Build a Semi-Automated MT5 Execution Assistant (MQL5) with Custom Panel Description: I am looking for an experienced MQL5 developer to build a semi-automated execution assistant for MetaTrader 5. I know this is a standard semi-automated panel with trade management. I am looking for a developer who has an existing GUI/panel library and standard trade management modules that can be adapted quickly. If you are
Trade copier EA 40+ USD
Develop a low-latency trade copier EA supporting MT4 and MT5 in all directions, across different brokers, with one master account copying to multiple follower accounts. Automatically adapt symbol names, price digits, contract sizes, and lot-size limits, with manual symbol mapping available. Support fixed lots, lot multipliers, and equity-proportional sizing. Synchronize market and pending orders, modifications

Información sobre el proyecto

Presupuesto
85+ USD
Plazo límite de ejecución
a 2 día(s)