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

MQL4 Indikatoren Skripte

Auftrag beendet

Ausführungszeit 2 Stunden
Bewertung des Kunden
John knows his programming! And he did more than was expected. I can strongly recommend him to anyone who is looking for a programmer.
Bewertung des Entwicklers
Great customer, prompt communication, clear specs, recommended+

Spezifikation

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:


 



Bewerbungen

1
Entwickler 1
Bewertung
(630)
Projekte
995
47%
Schlichtung
33
36% / 36%
Frist nicht eingehalten
98
10%
Arbeitet
Veröffentlicht: 6 Beispiele
2
Entwickler 2
Bewertung
(90)
Projekte
136
14%
Schlichtung
43
21% / 28%
Frist nicht eingehalten
14
10%
Frei
Veröffentlicht: 2 Beispiele
3
Entwickler 3
Bewertung
(115)
Projekte
129
18%
Schlichtung
11
27% / 55%
Frist nicht eingehalten
4
3%
Frei
4
Entwickler 4
Bewertung
(163)
Projekte
236
32%
Schlichtung
30
27% / 30%
Frist nicht eingehalten
26
11%
Frei
5
Entwickler 5
Bewertung
(45)
Projekte
58
33%
Schlichtung
12
42% / 42%
Frist nicht eingehalten
7
12%
Frei
6
Entwickler 6
Bewertung
(3)
Projekte
4
0%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
1
25%
Frei
7
Entwickler 7
Bewertung
(265)
Projekte
280
55%
Schlichtung
0
Frist nicht eingehalten
5
2%
Frei
8
Entwickler 8
Bewertung
(24)
Projekte
28
32%
Schlichtung
1
0% / 0%
Frist nicht eingehalten
0
Frei
Veröffentlicht: 1 Beispiel
9
Entwickler 9
Bewertung
(21)
Projekte
24
17%
Schlichtung
15
20% / 40%
Frist nicht eingehalten
6
25%
Frei
10
Entwickler 10
Bewertung
(1156)
Projekte
1462
63%
Schlichtung
21
57% / 10%
Frist nicht eingehalten
43
3%
Frei
11
Entwickler 11
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
12
Entwickler 12
Bewertung
(41)
Projekte
46
28%
Schlichtung
9
0% / 100%
Frist nicht eingehalten
7
15%
Frei
13
Entwickler 13
Bewertung
(3)
Projekte
4
0%
Schlichtung
1
100% / 0%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
Hello, I have a Ctrader indicator with the source code, I was wondering if this possible to convert it to Quantower. Hello, I have a Ctrader indicator with the source code, I was wondering if tis possible to convert it to Quantower., i need an expert who can convert it perfectly
I’m looking for an experienced NinjaTrader developer to complete an existing custom indicator. The project is already partially built and is well organized, completely functional, and well documented. The former developer experienced some personal difficulties and unfortunately cannot continue. Key Requirement (Read Carefully): You MUST have direct, hands-on experience with NinjaTrader and NinjaScript (C#) . This is
MT5 Indicator SMC 30 - 100 USD
Hello, I would like to clarify something before we proceed. I already have a base code prepared for the indicator. However, the code is not the final version and it still requires professional refinement, debugging, and optimization. Because of this, I am specifically looking for a highly experienced developer who can understand the full logic and structure of the system and improve it properly. Before I send you the
I already have a fully developed MT5 Expert Advisor with all required prop firm features, including: Risk management Daily loss & max drawdown limits Spread & slippage filters News filter Trade management system The EA structure is complete. 👉 What I need is a professional developer to replace ONLY the entry logic with a high-quality, rule-based trading strategy. 🚨 STRICT REQUIREMENT (READ CAREFULLY): I am NOT
SMC Price Action Pro 30 - 100 USD
Hello, I have a source code for an MT5 indicator that is open-source and belongs to me. However, it still requires professional improvements and some corrections. At the moment the indicator does not work as expected and there are several issues in the logic and performance that need to be fixed. Because of this, I am looking for a highly experienced MT5 developer who is comfortable working with existing code
Hello, I’m looking for an experienced developer who can help convert an existing cTrader indicator into a fully functional Quantower indicator . I already have the complete source code for the cTrader indicator (written in C#) , and I would like the same logic, behavior, and visual output to be accurately replicated in Quantower
Hello Developers I have a Project to get done! i have a simple strategy can you please create the automated forex ea to execute my trading strategy? i need custom ea for tradingview and mt4/mt5 correction: i need a tradingview indicator created that tells me when to buy or sell. and ea in mt4/mt5
Mam kody EA Bot. Chciałbym je dokończyć, dopracować i ukończyć projekty. Chciałbym otrzymać pliki SET po ukończeniu EA. Jeśli jesteś zainteresowany, skontaktuj się ze mną. Szukam doświadczonego programisty do stworzenia dedykowanego doradcy eksperckiego (EA) do tradingu. Programista powinien posiadać solidną wiedzę z zakresu MT5, logiki strategii, wskaźników, zarządzania ryzykiem i backtestingu. Doświadczenie w
Salary ₹25,000 – ₹75,000 per month (based on capability, not years) Performance bonuses based on execution quality & system edge Project-based incentives for high-impact deliveries Annual bonus for consistent performers Perks & Benefits 4 months leave/year (designed for deep work cycles) 15 casual leaves Work on real trading engines, not basic bots Qualification 2–5+ years in MQL5 / MT5 development (preferred) Must
I am looking for an experienced MQL5 developer to create a custom technical indicator for MetaTrader 5. The indicator should combine Supertrend logic with Support/Resistance pullback levels to generate high-probability entry signals. 1. Core Logic The indicator must follow a two-step confirmation process: Trend Identification: Use the Supertrend indicator to determine the primary trend. Entry Signal (The

Projektdetails

Budget
30+ USD
Ausführungsfristen
bis 2 Tag(e)