Standard indicators override?! - page 4

 
Of course...
here's the data from the files


and here's this bar on the chart


and this is not the only case, it's just one example of many.
All of these bars are related to "Sunday" bars.
 
and here it is in the quote archive
 
Didn't you find it strange that there is a bar with an opening time of 2300 hours on the four o'clock?
 
The first time you see it, it's obviously redundant, as there are 20:00 and 00:00, everything is as I suggested in my first post in this thread,
but the fact that it can not position an object (build a line), probably something else with a quote base, if you think you need it, try first nail it, and then manually add
 
I've read about the rising bars. Maybe (for the indicator) it is the iBarShift() function
<br/ translate="no"> int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
Search for bar by time. The function returns the offset of the bar to which the specified time belongs. If there is no bar for the specified time (a "gap" in the history), the function, depending on the exact parameter, returns -1 or the shift of the nearest bar.

Parameters:
symbol - symbol name of the instrument. NULL means the current symbol.
timeframe - Period. Can be one of the chart's periods. 0 means period of current chart.
time - Time value to search.
exact - Returned value if no bar is found. FALSE - iBarShift returns the closest one. TRUE - iBarShift returns -1.

Example:
datetime some_time=D'2004.03.21 12:00';
int shift=iBarShift("EUROUSD",PERIOD_M1,some_time);
Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);




I'll try to look at the MiG quotes, later.
 
I've already been asked that question on a previous page. :о)
No, it wasn't.
It's a regular "Sunday" bar, and it does open at 23:00. FIBO, for example, has "Sunday" bars that start at 10 p.m.
 
Checked it out, all confirmed.True, I still managed to set the line in the right place. For this I switched to the clocks first. I think when setting an object it always looks for the nearest bar to the exact Period() minutes.

 
The final version of the indicator using the second currency.
Different bar arrival times as well as omissions in the history are taken into account.
Criticism is welcome.

#property copyright "Copyright Quark"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Lime

// indicator parameters
extern int nPeriod = 6;

double arrOpen[];

int nExtCountedBars = 0;

int nBars;
int nBarsUsdChf;

////////////////////////
int init()
{
	nBars = 0;
	nBarsUsdChf = 0;

	string strIndicatorShortName = "Test_1(" + Symbol() + " " + nPeriod + ")";  
	IndicatorShortName(strIndicatorShortName);

	// drawing settings
	SetIndexStyle(0, DRAW_LINE);
	SetIndexShift(0, 0);

	IndicatorDigits(4);
		
	// indicator buffers mapping
	SetIndexBuffer(0, arrOpen);
		
	return(0);
}
///////////////////////////
int start()
{
	if(Bars <= nPeriod) 
		return(0);
		
	if(nBars == Bars || nBarsUsdChf == iBars("USDCHF", 0))
		return(-1);

	int nPos = Bars - nBars;
	
	int nPosUsdChf = nPos;
	
	nBars = Bars;
	nBarsUsdChf = iBars("USDCHF", 0);
		
	while(nPos >= 0)
	{
		// Adjust nPosUsdChf, so that time is the same as in EURUSD
		// If Time(USDCHF) < Time(EURUSD), decrease nPosUsdChf
		while(nPosUsdChf > 0 &&
			TimeDay(Time[nPosUsdChf]) < TimeDay(Time[nPos]) ||		// Yerterday vs. Today
			(TimeDay(Time[nPosUsdChf]) == TimeDay(Time[nPos]) &&		// Same day
				TimeHour(Time[nPosUsdChf]) < TimeHour(Time[nPos])))
			nPosUsdChf--;

		// Now, if Time(USDCHF) > Time(EURUSD), increase nPosUsdChf
		while(nPosUsdChf < Bars &&
			TimeDay(Time[nPosUsdChf]) > TimeDay(Time[nPos]) ||		// Yerterday vs. Today
			(TimeDay(Time[nPosUsdChf]) == TimeDay(Time[nPos]) &&		// Same day
				TimeHour(Time[nPosUsdChf]) > TimeHour(Time[nPos])))
			nPosUsdChf++;

		arrOpen[nPos] = iOpen("USDCHF", 0, nPosUsdChf);

		nPos--;
		nPosUsdChf--;
	}

	return(0);
}


 
Stupid question: what is the purpose of the variable "nPeriod" other than to show off its name? ;о)
 
Stupid question: what is the purpose of the "nPeriod" variable other than to show off in the name? ;o) <br / translate="no">


Э... It's just that there was an MA, and then I removed it. But not all the way :)
Reason: