Solve this problem: Calculated Moving average mode SMMA different in strategy tester visualization compared to normal chart

작업 종료됨

실행 시간 2 시간
고객의 피드백
Very good job. Very engaged!
피고용인의 피드백
Very thanks for order! Please let me know if you need programmer.

명시

I found out that the calculated moving average (mode SMMA) is different vom the same moving average in the normal chart window.

The consequence is a wrong behavour of the EA.

Let's take this small "EA" to show the problem:

void OnTick()
  {
      // Create an array
      double myMovingAverageArray[];
      
      // define properties of moving average
      int MovingAverageDefinition = iMA (_Symbol, _Period, 400, 0, MODE_SMMA, PRICE_CLOSE);
      
      // sort the price array downwards
      ArraySetAsSeries (myMovingAverageArray, true);
      
      // Copy values
      CopyBuffer (MovingAverageDefinition, 0, 0, 3, myMovingAverageArray);
      
      // Calculate moving average for the current candle
      double myMovingAverageValue = myMovingAverageArray[0];
      
      // Print the value on chart
      Comment ("myMovingAverageValue: ", myMovingAverageValue);
   
  }


The EA is working with the dow jones index and has the following settings:

EA settings


This is the standard chart with the moving average (black line):

Standard Chart Window

This is the settings of the moving average:


I saved exactly this chart as template "tester.tpl".

Then I start the EA.

Result:

As you can see, the values for the moving average on the "standard chart" is different from the moving average produced by the tester:

Date Mode Value Standard Chart Value Tester
28.12.2018 SMMA 22107 23459


What I also found out:

- The problem only appears in the "SMMA" mode. If I use the "SMA" mode, then there is no difference between normal chart and tester.

- If I rise the number of periods from 400 to 600 (in mode "SMMA") then the moving average does not appear at all in tester.


Job: Fix this problem by

- modifying the small EA (see above) OR

- create an indicator

The Job is done when the correct values (= same values as in the normal chart) of the SMMA 400 are available in strategy tester / mql5 code for further calculations












































응답함

1
개발자 1
등급
(1127)
프로젝트
1429
62%
중재
21
57% / 10%
기한 초과
43
3%
무료
2
개발자 2
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
I need EA that works on MT5 to be able to do the following: - Can recognize Support/Resistance area - Can recognize VWAP direction. - Can recognize RSI. - Can recognize Double Top/bottom, Bullish/Bearish hammer candle, Bullish/bearish engulfing candle. - Ability to set Stoploss below/above support/resistance, but risk must be fixed at a certain price. - Stoploss
I want a program that will help calculate and enter the market on full margin for me. I just need to put in the price for entry, Stop loss and TP then it will calculate the lot sizes for entering the trade on full margin on Mt5
I am seeking a highly skilled and experienced developer to assist with an important project. I need a development of an automated trading bot for NinjaTrader, utilizing a 4 SMA (Simple Moving Average) crossing strategy, with additional custom diversions for trade entries. The bot needs to be based on a strategy involving the crossing of four different SMAs. The exact periods for these SMAs and the conditions for
So i have copier EA. The idea is the EA will triggered through manual OP by user via mobile or whatever platform. Let's say 0.01 lot to trigger it. After the EA takes master's position, the EA will be standby mode. If the master take more OP, the EA still not take the master's position (OP) until the user input manually once again via mobile for another 0.01 lot. Since this is a MT4 EA, Whenever user want to close
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
Description - An expert advisor(s), placing sell trades in EUR/USD, based on the close price of the previous two candles, as shown in the figure below. The trades would be made in the 5 minute, 1 hour, and 1 day timeframes. In the 5 minute and 1 hour timeframes the market orders would be placed at the start of a new candle, at specific times EST. The order would be cancelled at the close of that candle, i.e after 5
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
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
Hi, I have an indicator from my friend, I want to copy it to my own Traidingview or MT5 can you do that for me. Here is the link
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

프로젝트 정보

예산
30+ USD
VAT (19%): 5.7 USD
총: 35.7 USD
개발자에게
27 USD