Adding of Proposed vs Current Value at Risk Filter

MQL5 Indicateurs Experts

Tâche terminée

Temps d'exécution 10 heures

Spécifications

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


Répondu

1
Développeur 1
Évaluation
(223)
Projets
356
17%
Arbitrage
21
43% / 33%
En retard
18
5%
Chargé
2
Développeur 2
Évaluation
(9)
Projets
20
10%
Arbitrage
3
67% / 33%
En retard
5
25%
Gratuit
3
Développeur 3
Évaluation
(8)
Projets
18
17%
Arbitrage
3
67% / 0%
En retard
0
Gratuit
Commandes similaires
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
BUY AND SELL INDICATOR AND SMAFS(LOXX) 80 20 MIDDLE CROSS FROM TRADING VIEW I want a programmer who can give me buy and sell indicators with SMAFS middle cross to confirm the direction of the market. Supply and demand indicator which shall be optional to use The time frame is 1hr (can be adjustable to change to any time frame) PROFIT AND LOSS. EA that can manage my trading style, 3 types of trails, open and close
An Expert Advisor based on Forex needen we need people who can trade, we need people who are learning how to trade , all people that are in this trading industry
Apply for the above heading I need the bot that does exactly the same please if you're not the one who developed it please don't apply and I need the proof of screen shot of that BOT with the startegies behind it I hope am understood
Hi, I have 2 EAs which are already developed for MT5. I need anyone who can create similar EA for cTrader. I am already having Source Code of my EA Strategy
Hi! I want a MT4 expert advisor that follows all the rules that are explained in the attached picture. This EA is based on 2 indicators but it has other variables. All the principles and the rules are explained on the picture i attached. This EA should also be ready to sell here on MQL5.com if i want to. The indicators and the explanations are as well attached. Thanks
** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd **Stop Loss **: - ** For long Entries *: stop loss is triggered on a ** candle close above the high* of the breaker block shown by the indicator. - ** For Short Entries **: stop loss is triggered on a ** candle close below the low ** of the breaker block
Hello, am in need of a developer that can help in developing a trading bot that can effectively navigate the foreign exchange (Forex) market or other financial markets to generate passive income. My objective is to create a sophisticated algorithmic trading system that can consistently produce profitable trades with minimal manual intervention. I am seeking a reliable and efficient solution that can be tailored to my

Informations sur le projet

Budget
85+ USD
Pour le développeur
76.5 USD
Délais
à 2 jour(s)