Simple MQL4 Indicator to Boolean Variable Conversion

MQL5 Indicadores Experts

Trabalho concluído

Tempo de execução 13 horas
Comentário do cliente
good
Comentário do desenvolvedor
Thank you

Termos de Referência

I have gotten an indicator called RVOL, which measures the relative volume of a symbol against the past days of trading.

This is currently an indicator format.

What I need is this converted into a bool / double that reflects the same value shown in the indicator.

To understand further.

1) Watch the video provided (zip file)

2) Have a look at the code

3) Have a read of the rest of the description.

Note: I need developers who are able to deliver on time so please only apply if you can complete this task


This the main indicator section of code:

void CalculateRelVolume(const int startBar, const int rates_total, const long& volume[])
{

   vol[startBar] = (double)volume[startBar];

   int i = startBar;
   if (i >= rates_total) i = rates_total - 1;
   for (; i > 0 && !IsStopped(); i--)
   {
         double curr_volume = (double)volume[i];
         double mean_volume = 0.0;         
         
                        for(int j = 1; j <= AveragingDays; j++) 
                        mean_volume += (double)volume[i + (j * BarsIn24Hours)]; 
         
                        mean_volume /= (double)AveragingDays;
         
                        //N.B. Value of 1.0 represents current vol is equal to average volume, 0.0-1.0 is below average, >1.0 is above average
         if(mean_volume>0)
                        vol[i] = curr_volume / mean_volume;            
         if(vol[i] > indicator_level1) volHigh[i] = vol[i];         //If current vol higher than average     
         else if (vol[i] > indicator_level2) volMedium[i] = vol[i];   //If current vol lower than average     
         else volLow[i] = vol[i];
   }
}

Note there are more parts to this indicator. But simple answer is vol[i] is the value that needs to be fetched.


This is my first attempt: (Note I do not want to have to fetch iCustom)


bool RVOL1(string symb1)
{
double RVOL = iCustom(symb1, PERIOD_M1,"RVOL", 5, 3, 1);

double RVOL_MAX = 1.0;

   if(RVOL < RVOL_MAX)
   return true;

   else
   {
   return false;
   }
   
   return false;
}


This is my second attempt at it:


   bool isVolumeBelowAverage(string symb) {
    
    bool state = false;
    int averagingDays = 5;
    
    int rates_total = Bars(symb, PERIOD_M1);
    int barsIn24Hours = 0;

    datetime prevDateTime = iTime(symb, PERIOD_M1, 0) - (86400 * 7);
    int numBarsIn7Days = iBarShift(symb, PERIOD_M1, prevDateTime, false);
    barsIn24Hours = numBarsIn7Days / 5;
    
    if (barsIn24Hours == 0) return false;
    
    double curr_volume = iVolume(symb, PERIOD_M1, 0);
    double mean_volume = 0.0;
    
    for (int j = 1; j <= averagingDays; j++) {
        mean_volume += iVolume(symb, PERIOD_M1, 0 + (j * barsIn24Hours));
    }
    
    mean_volume /= (double)averagingDays;
    double relVolume = 0.0;
    
    if (mean_volume > 0) {
        relVolume = curr_volume / mean_volume;
    }
    
    if(relVolume < 0.8)
    {
    state = true;
    }
    
    return(state) ;
}


Arquivos anexados:

ZIP
rvol.zip
6.8 Mb

Respondido

1
Desenvolvedor 1
Classificação
(43)
Projetos
66
12%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
2
Desenvolvedor 2
Classificação
(268)
Projetos
602
34%
Arbitragem
65
20% / 57%
Expirado
147
24%
Trabalhando
Publicou: 1 artigo, 22 códigos
Pedidos semelhantes
I am looking for a highly experienced developer to build a professional, commercial-grade trading indicator for MT4/MT5. I am not looking for a basic indicator or a modified public script. I need a custom solution based on real market logic with high-quality coding standards. Requirements 100% Non-Repainting indicator. Accurate Entry signals. Automatic Stop Loss placement based on real market structure. Automatic
I need a custom MT5 Expert Advisor (MQL5) for XAUUSD. Strategy: 1. Trend Filter (H1) - EMA 20, EMA 50 and EMA 200. - Buy only when EMA20 > EMA50 > EMA200 and price is above EMA200. - Sell only when EMA20 < EMA50 < EMA200 and price is below EMA200. 2. Confirmation (M15) - M15 trend must confirm the H1 trend before taking any trade. 3. Entry (M5) - Wait for price to pull back to EMA20 only. - After touching EMA20, wait
Mac200 50+ USD
I need a Trend following Bot. Here we took entries by looking at two indicator which are 200 period ema and 12 26 9 MacD. Rules for entry exit are: Buy trade: When market is above 200 ema and MacD Line cross over the signal line and this cross over happened below the zero line of MacD indicator. We simply put Buy trade. Sell trade: When market is below 200 ema and MacD line crosses below the signal line and this
I I would like to create a trading robot based on 2 ema crossing. The robot is pretty simple, it should open buy position when fast ema cross slow ema and vise versa. Also it should use martingale after the loss position. It should has expiration period inside the code and alerts l
Iconic Boy 300 - 400 USD
Am looking for a bot to trade .so that I can be able to trade and become very successful and make some profit so that I cannot sleep on a empty stomach
MT5 Global Stop Loss & Take Profit Manager for Manual Trades I need an Expert Advisor (EA) for MetaTrader 5 that manages ONLY existing manual trades. GENERAL REQUIREMENTS - Works only on the current chart symbol (example: XAUUSD). - Supports Hedging accounts. - Detects all manually opened market positions. - Never opens trades automatically. - Never closes trades automatically. - Never places pending orders. - Never
Supply and Demand EA 50 - 250 USD
I need a SnD EA. Prefer coder who has previous experience coding SnD EA. PO are based on (CHoCH or BoS) and 3EMA, order block (from my TradingView indicator), area based on Fibonacci. SL options are based on fix pips or zone size; CL is based on candle closing. TP1 and TP2 options are based on fix pips or fix ratio. Canceling PO is based on market structure or Fibonacci. Money management are based on fix volume or
Hi MQL5 Community, With over 10 years of live market experience as a Quantitative & Trading System Developer, I specialize in building robust, highly scalable Expert Advisors (EAs), custom indicators, and automated architectures. I’ve recently put together a comprehensive showcase demonstrating my flagship Modular Multi-Engine Architecture , designed to bring institutional-grade logic and real-time telemetry into
I need a developer that can make my trading strategies into a working perfect EA Robot working on Mt5. Candlestick pattern confirmation through PDH, PDL, PWH, PWL, Liquidities, HTF OB
I need a trading bot specially for XAU, high profit gain. Requirements bot analyzes the market places trades closes with 2 to 3 profit per trades daily profit should be 50 to 100 dollars

Informações sobre o projeto

Orçamento
30+ USD
Prazo
para 1 dias