A real question - page 10

 
m100:

goldtrader ,maybe I'm asking you too dumb a question, but still, where does the "Data window" get all the values from?


That's a question for the MT4 terminal developers. I think it comes from the buffers of the relevant indicators and time series.
 
goldtrader:
This is a question for the MT4 terminal developers. I think that from the buffers of the corresponding indicators and timeseries.

So there is no equivalent function like GetWindowsData(3 buffer,0 bar) ?

GetWindowsData came up with it myself.

 
goldtrader:

Read msdn, WinApi, WindowHandle. I am not an expert in these technologies. Keep in mind that for your task it's a BLEEP.

There is something here https://www.mql5.com/ru/forum/120356

To get those values from the data window - you need to have the mouse cursor always over the desired window

as soon as the cursor moves somewhere or loses focus - the window stops refreshing

 
m100:

So there is no equivalent function like GetWindowsData(3 buffer,0 bar) ?

Obviously not, because everything you need is there and you don't need redundancy. The data window is essentially unnecessary.
 
OK thanks everyone, I'll take the drknn's code apart
 

Perhaps it's worth explaining something to make things clearer.

The line MyValue=MyValue/(PeriodSkolzjaschej+1); 1 is added to the variable PeriodSkolzjaschej because the loop will start the search from the candle with number = PeriodSkolzjaschej and finish with zero candle. Therefore the total number of candlesticks which participated in the loop will be equal to PeriodSkolzjaschej+1. This means that if PeriodSkolzjaschej=35, the MA with period=36 will actually be involved. In order to get a 35-period moving average without changing anything in the code, we need to set PeriodSkolzjaschej variable to 34.

 
drknn:

Perhaps it's worth clarifying a few things to get the point across.

The line MyValue=MyValue/(PeriodSkolzjaschej+1); 1 is added to the variable PeriodSkolzjaschej because the loop will start the search from the candle with number = PeriodSkolzjaschej, and it will end with zero candle's reading. Therefore the total number of candlesticks which participated in the loop will be equal to PeriodSkolzjaschej+1. This means that if PeriodSkolzjaschej=35, the MA with period=36 will actually be involved. In order to get a 35-period moving average without changing anything in the code, we need to set PeriodSkolzjaschej variable to 34.

thanks

Is applied_price an extra variable?

 
m100:

thank you

Is applied_price an extra variable?


No - by default I set iMACD() to zero, which means that the indicator should be built based on close prices. If I allow the user to choose, then the request for the indicator value should be done like this

Main_MACD=iMACD(SMB,0,fast_ema_period,slow_ema_period,signal_period,applied_price,0,0);

Signal_MACD=iMACD(SMB,0,fast_ema_period,slow_ema_period,signal_period,applied_price,1,0);

// ------- Усредняем сигнальную линию ------------------
for(int i=PeriodSkolzjaschej;i>=0;i--){
 MyValue=MyValue+iMACD(SMB,0,fast_ema_period,slow_ema_period,signal_period,applied_price,1,i);
}
Reason: