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
評価
(634)
プロジェクト
1003
47%
仲裁
33
36% / 36%
期限切れ
98
10%
仕事中
パブリッシュした人: 6 codes
2
開発者 2
評価
(90)
プロジェクト
136
14%
仲裁
43
21% / 28%
期限切れ
14
10%
パブリッシュした人: 2 codes
3
開発者 3
評価
(115)
プロジェクト
129
18%
仲裁
11
27% / 55%
期限切れ
4
3%
4
開発者 4
評価
(163)
プロジェクト
236
32%
仲裁
30
27% / 30%
期限切れ
26
11%
5
開発者 5
評価
(45)
プロジェクト
58
33%
仲裁
12
42% / 42%
期限切れ
7
12%
6
開発者 6
評価
(3)
プロジェクト
4
0%
仲裁
2
0% / 100%
期限切れ
1
25%
7
開発者 7
評価
(267)
プロジェクト
282
55%
仲裁
0
期限切れ
5
2%
8
開発者 8
評価
(24)
プロジェクト
28
32%
仲裁
1
0% / 0%
期限切れ
0
パブリッシュした人: 1 code
9
開発者 9
評価
(21)
プロジェクト
24
17%
仲裁
15
20% / 40%
期限切れ
6
25%
10
開発者 10
評価
(1156)
プロジェクト
1462
63%
仲裁
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
類似した注文
✅ MT4 EA Developer Checklist (For Your Ladder EA) 1️⃣ Indicator Integration EA reads signals from provided custom indicator (.ex4 or .mq4) Detects “Buy Next” / “Sell Next” signals on current candle Works with arrow-based or buffer-based signals 2️⃣ Next Candle Execution EA does not trade on the candle where the signal appears Orders placed only at first tick of the next candle Timeframes supported: M1, M5, M15
Hello, i need expert developer that have been develop so many profitable AI bots that work for mt5 and ctrader autonomously if you know you can easily execute this requirement bid for it. NOTE:- YOU MUST COME WITH SAMPLE FOR THE 2 TRADING PLATFORM. While i take a look at your profile and reach out to you thanks
I am looking for an experienced MT4/MT5 developer to analyze my trading history and replicate the strategy in a new Expert Advisor (EA). The developer must have proven experience in reverse engineering strategies, analyzing trading data, and developing EAs across various trading methodologies. A deep understanding of XAUUDS and BTCUSD behavior, as well as chart analysis, is essential. Please note that we do not have
Ea.Mix 30+ USD
I am in need of a good scalping bot for gold or any currency pair. If you have one that is working, reach out. You must be able to provide a trial version so I can test the bot myself
I am in need of a good scalping bot for gold or any currency pair. If you have one that is working, reach out. You must be able to provide a trial version so I can test the bot myself
i have built a indicator on trading view which is veryt good, its based on liquidity sweeps on stop losses. im looking for an someone with experience in trading and indicators that has worked on similar strategy indicators. it already wins lots of very good trades im looking to tighten up on uneccesary trades it may send to clean it up as i currently am testing it out running to signal channel and want it the best /
I am looking for an experienced MQL5 developer to create a custom indicator for MetaTrader 5. The project requirements and indicator logic will be shared privately with the selected candidate to protect the concept and implementation details. Requirements: Strong experience with MQL5 indicator development. Ability to create clean, efficient, and well-structured code. Experience with custom buffers, chart objects
Hello, I am looking to develop a commercial-grade Expert Advisor for MT5 specifically optimized for XAUUSD (Gold). The underlying logic should be an intelligent, trend-filtered cost-averaging grid system focused on capital preservation. The EA must include the following functional architecture: 1. Core Strategy Structure: - Must feature a multi-strategy logic entry module. I want to use a combination of 3-4 standard
Generate a signal and place 2 arrows on the chart when these conditions happen. Rules: Levels up:price is below the Kijunsen and Senku A value is less than Senku B value Kijun sen close = previous kijun sen close; Kijun sen close value is LESS than Senku B close value Senkou B close = previous senku B close. Levels down: price is above Kijunsen. Senku A value is above Senku B value
ZigZag based on oscillators is needed The idea of ​​the indicator Create a ZigZag indicator, which is constructed based on extreme values determined using oscillators. It can use any classical normalized oscillator, which has overbought and oversold zones. The algorithm should first be executed with the WPR indicator, then similarly add the possibility to draw a zigzag using the following indicators: CCI Chaikin RSI

プロジェクト情報

予算
30+ USD
締め切り
最高 2 日