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
(42)
Projetos
62
8%
Arbitragem
12
58% / 42%
Expirado
1
2%
Livre
2
Desenvolvedor 2
Classificação
(254)
Projetos
572
36%
Arbitragem
64
20% / 58%
Expirado
147
26%
Livre
Pedidos semelhantes
preciso de um robô com duas médias móveis, uma exponencial high e uma exponencial low. preciso também ter a opção de utilizar e todos os tempos gráficos e alterar os parâmetros das médias. entrada de compra será feita quando um candle de alta romper e fechar a cima da média high e fechará a posição quando um candle de baixa romper e fechar a baixo da média low. a venda será feita quando o candle de baixa romper e
Greetings, As the title suggests, I am trying to convert an indicator that calls itself via an iCustom call like this. iMAArray_Buffer[loop_1] = iCustom ( NULL , Selected_TF, MQLInfoString ( MQL_PROGRAM_NAME ), "calculate" , RPeriod, MType, MPeriod, 1 , shift); Full code will not be provided, only the position that needs fixing. I cannot get this working in MQL5 but the original code runs smoothly in MQL4. Please
I need a chart to replicate/track my equity + Balance Curve into my mt4. Also this chart i need to be able to add Stochastic / Bollingerband / Moving average on the equity/balance curve. Besides the equity curve i would like the indicator to show the Line-chart of my win + 1 and my loss -1 which results in a win-loss curve. ( i will discuss this with the choosen developer in depth. ) More information on what i want
Greetings great developer, I am in search of a highly skilled developer to assist with an exciting project. I need to convert two open-source TradingView indicators to NinjaTrader 8 and implement a usage restriction based on computer IDs. If you have experience with NinjaTrader 8 coding please let me know. I’d be happy to discuss the details further
Hello, This is pretty simple and its an indicator with On/Off button 1-Off will remove all indicator from the chart. 2-On will put them all back again with the same settings
Trading bot 300+ USD
We need bot that trades when medium and low impact news hits It will release pending order both directions few min prior to news impact And will have certain risk management strategy attached Example If Monday and Tuesday news successful clears profits It will reduce risk for next news events until new week starts each week message on tg: Dstatewealthtrading NOTE: 4 YAERS OF EXPERIENCE UPWORD, YOU MUST BE A
I need someone the create a supertrend indicator based on Heikin Ashi candles instead of normal candles. Needs to be exactly the same as the supertrend (original one) + ha from tradingview. In m1,m5,m15 the indicator must have the same values ​​found with the tradingview. Work that meets this requirement will be accepted ( depending on the broker and spread, however, a few pips of difference will be accepted)
Here is a detailed instruction for the coder to implement the vertical lines based on the BrainTrainSignalAlert indicator: --- **Task: Implement Vertical Lines for Alerts from BrainTrainSignalAlert Indicator** **Objective:** Create a system that adds vertical lines on specified timeframes (M5 or M30) whenever an alert is generated by the BrainTrainSignalAlert indicator on the H1, H4, and D1 timeframes. The lines
Hello Guys! I want to modify/fix the indicator that uses sequential type of entries (it calculates from 1 to 9) and if the conditions are met it provides an arrow (signal) with alert. The problem is that, sometimes (for unknown for me reasons) it repaints arrow signal. Like on the picture: Signal 1 - correct signal Signal 2 - correct signal Signal 3 - correct signal Signal 4 - repaints (signal 3 arrow dissapeared
Hi, I have a Live Data feature for my trading accounts that lets me check details like total open positions, number of lots, profits, etc. I need someone to add the number of pending orders to this live data. This is important for me to ensure that all accounts have the same number of pending orders, since I use a copy trading system. Also, there is a website where I check all the data. In this case, you would need

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD
Prazo
para 1 dias