Hi, I am trying to set up an EFS that brings up the Highest High and Lowest Low of the previous 3 days, in a 5min chart.
I know the basic of coding, but I am getting an error message when I try to load the EFS, as I think when the program first runs, there is not enough bars to calculate the highs/lows of the past 3 days.
Is there a simple way to solve this, say by making sure the bar count is over 100 or something like that. I have tried but I still cant figure it out. Any help would be greatly appreciated
PS - Any idea why my date wont print either?
function main()
{ var xdayhigh = threeDayHigh(); // the highest high of the user defined range
debugPrintln(" xdayhigh value is " + xdayhigh.toFixed(2) + " on date " + h ) return xdayhigh; }
function threeDayHigh() {
var nNumBars = getCurrentBarCount();
{ if ( nNumBars < 100) return 0; }
{
var xlessone = high(-1, inv("D") );
var xlesstwo = high(-2, inv("D") );
var xlessthree = high(-3, inv("D") ); var xMaxx = Math.Max(xlessone, xlesstwo, xlessthree) return xMaxx; //
}
}
I know the basic of coding, but I am getting an error message when I try to load the EFS, as I think when the program first runs, there is not enough bars to calculate the highs/lows of the past 3 days.
Is there a simple way to solve this, say by making sure the bar count is over 100 or something like that. I have tried but I still cant figure it out. Any help would be greatly appreciated
PS - Any idea why my date wont print either?
function main()
{ var xdayhigh = threeDayHigh(); // the highest high of the user defined range
debugPrintln(" xdayhigh value is " + xdayhigh.toFixed(2) + " on date " + h ) return xdayhigh; }
function threeDayHigh() {
var nNumBars = getCurrentBarCount();
{ if ( nNumBars < 100) return 0; }
{
var xlessone = high(-1, inv("D") );
var xlesstwo = high(-2, inv("D") );
var xlessthree = high(-3, inv("D") ); var xMaxx = Math.Max(xlessone, xlesstwo, xlessthree) return xMaxx; //
}
}
Comment