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
603
34%
Arbitragem
65
22% / 57%
Expirado
147
24%
Trabalhando
Publicou: 1 artigo, 22 códigos
Pedidos semelhantes
Project Overview I have an existing MT5 Expert Advisor (EA) written in MQL5. The source code ( .mq5 ) will be provided. The underlying strategy is a trend-following system that performs well during trending market conditions, but requires professional quantitative research to improve its ability to identify and avoid highly sideways/range-bound market conditions. The objective of this project is not to build a new EA
I am looking for an experienced MQL5 Expert Advisor (EA) developer to analyze an existing trading setup and develop a similar automated trading robot. Project Overview I have access to a demo trading account where trades are being executed automatically. The trading results look very promising, but I do not know exactly what strategy, logic, indicators, or trade-management rules are being used. I will provide access
Most of the expert is already coded . Create a panel to show the Ratio for the Range . Trigger is based on ratio . Show Distribution / project starts after we clear Distribution
Modification of existing ea …. Add ema filter, add risk percentage per trade, and modify the pips per day filter. I already have the ea code I just need these things added and modifified
Expert Advisors 300+ USD
double CRiskManager::CalculateLotSize(double slPoints) { double balance = AccountInfoDouble(ACCOUNT_BALANCE); double riskMoney = balance * (m_riskPercent / 100.0); double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE); double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE); double pointValue = tickValue / tickSize; double lot = riskMoney / (slPoints * pointValue);
i share my strategy i need a bot trending bot fo mt5 . i attached the photo with this it help to make bot. it basicly 1 hours time frame base. i try but failed to make it
Title: Simple background trading bot for my Oanda account (v20 REST API) Overview Hi, I need a simple, lightweight event based standalone trading bot that connects directly to my Oanda account using broker’s standard REST API (V20 account) via VPS The bot just needs to look at group of 5 currency pairs (manually selectable and adjustable) in different 4 baskets, do some basic percentage math every period, and place
MQL5 Developer 30+ USD
📄 وثيقة المواصفات الفنية لروبوت التداول (MQL5 EA Specification) 📌 1. ملخص المشروع والهدف * اسم المشروع: Gold Cent Grid-Hedge EA * المنصة: MetaTrader 5 (MQL5) * أداة التداول: الذهب (XAUUSD) * نوع الحساب: حساب سنت (Cent Account) * فكرة الاستراتيجية: تداول شبكة هيدج متوازنة (Grid-Hedging) تفتح صفقات تعزيز كل مسافة محددة، وتغلق الطرف الأكثر ربحاً عند تحقيق هدف مالّي مجمع بالدولار/السنت لإعادة هيكلة التوازن. ⚙️ 2
I need a developer who also understands trading. I have a Telegram copy-trading bot that reads signals from a Telegram channel via a Python script and converts them into trading orders. I want to create a program that analyzes Gold (XAUUSD) charts specifically and sends signals in this exact format: #XAUUSD BUY 4324-4321 TP 4327 TP 4330 TP 4334 TP 4339 TP 4344 TP 4354 TP 4364 SL 4311 If the # symbol is missing at the
Hi developer I want to convert my mt4 EA to mt5 EA . I have a mt4 ea with source code. i want developer to copy same mt4 code and create mt5 EA

Informações sobre o projeto

Orçamento
30+ USD
Prazo
para 1 dias