Guarda come scaricare robot di trading gratuitamente
Ci trovi su Twitter!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Current Relative Drawdown - sistema esperto per MetaTrader 5

Visualizzazioni:
5811
Valutazioni:
(8)
Pubblicato:
2023.02.16 19:31
Aggiornato:
2023.02.16 22:46
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

The DD_Relative function calculates the relative profit or loss (drawdown) of the current trading account in percentage. To do this, it uses the Current_LossOrProfit() function to get the current profit or loss of all open positions and then divides it by the current account balance obtained via the AccountInfoDouble(ACCOUNT_BALANCE) function.

After calculating the relative gain or loss in percentage, the function uses the NormalizeDouble() function to round the result to two decimal places, and then displays the result in the chart comment using the Comment() function. Finally, the function returns the result of the relative gain or loss in percentage.

The Current_LossOrProfit() function is used to calculate the current profit or loss of all open positions in the trading account. Loops through all open positions using a for loop, and for each position, checks if its magic number matches the magic number specified in the code (MAGIC) and if the symbol of the position is the same as the current symbol on the chart. If the position meets these criteria, the position's commission, swap, and current profit or loss are added to the Positionsprofit variable.

Once all the profits and losses of the positions have been added up, the function uses the NormalizeDouble() function to round the result to two decimal places, and then returns the value of the current profit or loss.

    Hurst Exponent - optimized version Hurst Exponent - optimized version

    Hurst Exponent - optimized version

    Check the time periods used Check the time periods used

    The function takes two arrays of integers as parameters: "allowedPeriods" and "periodsToCheck". "allowedPeriods" is an array containing all the time periods allowed by the system, while "periodsToCheck" is an array containing the time periods used by the user in the indicator. The function iterates through the elements of the "periodsToCheck" array and checks if each of them is present in the "allowedPeriods" array. If it finds any time period that is not allowed, the function returns "false". If all time periods are allowed, the function returns "true". In short, this function is used to make sure that the time periods used in an indicator are valid and allowed by the system.

    Get Position commission OrderCommission (mt4 term) of an active position in MT5 Get Position commission OrderCommission (mt4 term) of an active position in MT5

    Get commission of an active position in mt5 , its easy to use function.

    Weighted deviation Weighted deviation

    Weighted deviation