[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 19

 
OK, I'll read on!
 
Good people, help me find a bar of a previous trading session at the time N candle current session, for example, the current bar has time 12:00 need to find a bar with the time 12:00 but the previous session, tried this: datetime n1=some_time-24*3600+00*60; some_time(current candle) this scheme works if the days are in order, and does not work on Monday of the two weekends, and Monday we need the data for Friday, and my scheme asks for Sunday, how to fix?
 
Alexandr24:
Good people, help me find a bar from a previous trading session at the time N candle current session, for example, the current bar has time 12:00 need to find a bar with the time 12:00 but the previous session, tried this: datetime n1=some_time-24*3600+00*60; some_time(current candle) This scheme works if the days are in order, and does not work on Monday of the two weekends, and on Monday we need data for Friday, but my scheme asks for Sunday, how to fix?
If Monday --n1=some_time-72*3600+00*60;

MQL4 Reference - Date and Time - TimeDayOfWeek

int TimeDayOfWeek( datetime date)
Returns the day of the week (0-Sunday,1,2,3,4,5,6) for the specified date.
Parameters:
date - Datetime as number of seconds elapsed since 00:00 1 January 1970.
Example:
 int weekday=TimeDayOfWeek(D'2004.11.2'); // day 2 - Tuesday
 

I read. I asked very bluntly - and you confuse me, and again you send me away to read!!!

If I'm wrong though, then still how do you get a ka line for a stochastic, and how de?

It's written too dryly to be understood.

 

Yes 100% MODE_MAIN is the K line of the stochastic, and MODE_SIGNAL is the D line, although the help does not say so directly!

Our dialogue is giving me a headache! You're like my dad - ostentatious wisdom - a big carload, but tokoo!!! you're leading me somewhere around and only confuse me. I would have written something further by now. If I'm wrong, then explain, and excuse me, a fourteen year old! I won't understand for sure from the reference how to get De, and how to Ka.

 

 

Dimka-novitsek:


I read. I asked very bluntly - and you confuse me, and again you send me away to read!!!

If I'm wrong though, then still how do you get a ka line for a stochastic, and how de?

It's written too dryly to be understood.

Dimka, why do they really write "calculate the %K line"?

There are three variables used to calculate a stochastic oscillator:

Period %K . This is the number of unit periods used to calculate %K. The default value is 5;
Deceleration period %K . This value determines the degree of internal smoothing of the %K line.
A value of 1 gives a fast stochastic oscillator and a value of 3 gives a slow one. The default value is 3;
Period %D . This is the number of unit periods used to calculate the moving average of the %K line. The default value is 3.

 
Yeah. Sorry, too! I'm sorry.
 
I asked, having read the factsheet and not understanding it at first.
 
Smoothness one:
 
Ugh, not smoother, but slower. Here's ten: