Simple MQL4 Indicator to Boolean Variable Conversion

MQL5 Indicators Experts

Job finished

Execution time 13 hours
Feedback from customer
good
Feedback from employee
Thank you

Specification

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) ;
}


Files:

ZIP
rvol.zip
6.8 Mb

Responded

1
Developer 1
Rating
(42)
Projects
62
8%
Arbitration
12
58% / 42%
Overdue
1
2%
Free
2
Developer 2
Rating
(254)
Projects
572
36%
Arbitration
64
20% / 58%
Overdue
147
26%
Free
Similar orders
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange and forex market. I already have some source code to a strategy but would like to enhance it to make it profitable and automated
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it
Hello, I have an indicator from a friend and I'd like to replicate it on my own TradingView or MT5 platform. Could you assist me with that?. Here is the link

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
to 1 day(s)