Hi jcl, I am facing also strange behaviour with dayHigh/DayLow.
In manual there parameter definition :
Quote:
day Working day offset, i.e. 0 = today (see remarks), 1 = yesterday, 2 = day before yesterday, and so on. Weekends are skipped, f.i. if today is Monday, 1 refers to last Friday.


I am trying use this functionality with simple script with yesterday High/Low H1close. But unsuccessfully - script takes Sunday value and skip Friday ones frown
How to solve this issue? What I am missing? I tried set weekend start, but without success...


Trying on AUD/USD pair:
Code:
#include <profile.c>
#define H24 (1440/BarPeriod)
#define H4 (240/BarPeriod)
#define H1 (60/BarPeriod)
function run()
{
   BarPeriod = 60;	
	LookBack = 200;	
	StartDate = 20170620;
	EndDate = 20170706; 	
	//StartWeek=10000;
	//EndWeek=52350;
	static bool LongOp,LongSignal,ShortOp,ShortSignal;
   static int counter;	
	if(is(INITRUN))
	 { 
	 ShortOp=false;
	 LongOp=false;
	 ShortSignal=false;
	 LongSignal=false;
	 counter=0;
	 }

	vars Price=series(price());
	vars D1Close = series(priceClose());
	var Lowx,Highx;
	Lowx=dayLow(UTC,1);
	Highx=dayHigh(UTC,1);

   print(TO_LOG,"D1High= %f ,D1Low= %f",Highx,Lowx);
  
	if(crossOver(Price,Highx) and LongOp==false)
	{LongOp=true;ShortOp=false;counter=0;  plot("Dotted",1.01*price(),DOT,GREEN);}
	
	if(crossUnder(Price,Lowx) and ShortOp==false)
	{ShortOp=true;LongOp=false;counter=0;  plot("shorted",1.01*price(),DOT,RED);}
	
	plot("D1High",Highx,MAIN,BLUE);
	plot("D1Low",Lowx,MAIN,RED);
	set(PLOTNOW+TESTNOW+LOGFILE);
  }



Thanks

Last edited by debs; 11/08/17 14:26.