Please help me find the bug in 5 lines of MQL4 code

Работа завершена

Время выполнения 2 часа
Отзыв от заказчика
John knows his programming! And he did more than was expected. I can strongly recommend him to anyone who is looking for a programmer.
Отзыв от исполнителя
Great customer, prompt communication, clear specs, recommended+

Техническое задание

I need help with a small piece of code that calculates the moving average of the Williams Percent Range indicator.

Here is the code:

         ArrayResize(WPRArray, WPR_MAPeriod);

         for (int j = 0; j < WPR_MAPeriod; j++)
         {
            WPRArray[j] = iWPR(symbol, WPR_Timeframe, WPR_Period, j);
         }
         double WPR_Average = iMAOnArray(WPRArray, 0, WPR_MAPeriod, 0, WPR_MAMethod, 0);
         
         WPR = DoubleToString(WPR_Average, 0);

It gives different values on the indicator on the chart and the value in the variable calculated for WPR, e.g.
Here the value on the indicator is -52,4541 where the value in the Variable WPR = -73 (rounded off)



And here is another example:
Value of the indicator = -63.5457 but the variable has the value -41(rounded off)

I have researched the issue and found that there is a 12 hour difference where the value in the variable lags the value of the indicator. 

Here is a chart over 20 hours of the values of the indi and the var to illustrate:


 



Откликнулись

1
Разработчик 1
Оценка
(600)
Проекты
935
46%
Арбитраж
31
39% / 29%
Просрочено
93
10%
Свободен
2
Разработчик 2
Оценка
(87)
Проекты
134
14%
Арбитраж
41
22% / 29%
Просрочено
14
10%
Работает
3
Разработчик 3
Оценка
(115)
Проекты
129
18%
Арбитраж
11
27% / 55%
Просрочено
4
3%
Свободен
4
Разработчик 4
Оценка
(155)
Проекты
224
33%
Арбитраж
27
26% / 26%
Просрочено
23
10%
Свободен
5
Разработчик 5
Оценка
(45)
Проекты
58
33%
Арбитраж
12
42% / 42%
Просрочено
7
12%
Свободен
6
Разработчик 6
Оценка
(3)
Проекты
4
0%
Арбитраж
2
0% / 100%
Просрочено
1
25%
Свободен
7
Разработчик 7
Оценка
(184)
Проекты
199
47%
Арбитраж
0
Просрочено
5
3%
Свободен
8
Разработчик 8
Оценка
(24)
Проекты
28
32%
Арбитраж
1
0% / 0%
Просрочено
0
Свободен
9
Разработчик 9
Оценка
(21)
Проекты
24
17%
Арбитраж
15
20% / 40%
Просрочено
6
25%
Свободен
10
Разработчик 10
Оценка
(1135)
Проекты
1438
62%
Арбитраж
21
57% / 10%
Просрочено
43
3%
Свободен
11
Разработчик 11
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
12
Разработчик 12
Оценка
(41)
Проекты
46
28%
Арбитраж
9
0% / 100%
Просрочено
7
15%
Свободен
13
Разработчик 13
Оценка
(3)
Проекты
4
0%
Арбитраж
1
100% / 0%
Просрочено
0
Свободен
Похожие заказы
Where are my developers colleagues . i want you to support me on existing work i just need a little addon on it. Am still a student kindly support me. You will be get paid at the end of the work. If you want more details maybe the worth of the project or any other thing let me know. THNAKS FOR THE SUPPORT
** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd **Stop Loss **: - ** For long Entries *: stop loss is triggered on a ** candle close above the high* of the breaker block shown by the indicator. - ** For Short Entries **: stop loss is triggered on a ** candle close below the low ** of the breaker block
Hello, am in need of a developer that can help in developing a trading bot that can effectively navigate the foreign exchange (Forex) market or other financial markets to generate passive income. My objective is to create a sophisticated algorithmic trading system that can consistently produce profitable trades with minimal manual intervention. I am seeking a reliable and efficient solution that can be tailored to my
am looking for who help me convert tradingview indicator to mt5 car trading strategy and make sure you are an expert before u apply to this and also my budget for this is 30$ so the name of the indicator is Breaker Blocks with Signals (LuxAlgo) ### 1. ** Entry Condition **: - ** For Long**: The trade is entered **after BB + ** is confirmed. - ** For Short *: The trade is entered **after BB -* is confirmed. ### 2nd
I have a custom MT4 indicator that I need converted to MT5. I'll share the source code with the applicants. Please only apply if you have vast experience in converting complex indicators successfully to MT5, and making sure that the MT5 version functions exactly the same as the MT4 version
I need an expert to help me convert chopzone traingview pinescript to mt4, I need an expert to get it done for me on between 1 to 2 days i hope this will be done by then, i will attach the file and my budget is $30 as of minimum here
Looking for someone to edit/optimize and existing NN (neural network) in my EA so it is more compatible/profitable with the multiple strategies. The expert advisor is a portfolio expert advisor consisting of 33 separate advisors/strategies compiled into one. A NN has been added to the EA but it does not compliment or help the EA's performance. I've attached the original EA (without NN) as well as the EA with the NN
Procuro programador que consiga modificar essas estratégias, com a mesma capacidade de alteração das suas funcionalidades. Reitero, não consegui contato com o programador da fonte, nem mesmo mandando diversas mensagens no telegram! br.tradingview.com/script/PfpFNXyI-Braid-Filter/ br.tradingview.com/script/kv8N05R7-AlphaTrend-Screener/ Ambos os indicadores precisam agir em conjunto, tanto para as funcionalidades em
--- ### Basic Rules for You 1. **Time Management**: - All tasks should be completed within the agreed-upon timeframe. Clear deadlines will be set, and it's essential to adhere to them to ensure smooth progress. 2. **Fixed Budget**: - The budget for this project is fixed. Please ensure that all work done remains within this budget. Any additional costs must be discussed and agreed upon before proceeding. 3
CORREÇÃO NOTIFICAÇÕES Ø O indicador muda a cor dos candles e da MA200 quando ocorre as entradas e é somente nesse momento que ele deve enviar notificação de entrada porem está enviando em outros momentos que não atende as condições conforme imagem abaixo. Ø Sempre que abro o MT5, mudo o time frame ou a plataforma perde conexão o indicador me envia notificações de entradas passadas, o indicador deve enviar

Информация о проекте

Бюджет
30+ USD
Исполнителю
27 USD
Сроки выполнения
до 2 дн.