so i have been pulling my hairs out trying to figure what was wrong with my code and i finally realized that the EFS is not loading all the bars, only about 200, when there are over 1000 on the chart
any ideas why
here is the EFS
any ideas why
here is the EFS
PHP Code:
var myFlag = null; //
var a,b,c,d,e,v,w,x,y,z;
var high_3days=0;
var low_3days=1000000;
var high_5days=0;
var low_5days=0;
var a_highs = new Array();
var a_lows= new Array();
var bar_counter;
var xDaily_h = null;
var xDaily_l = null;
// 3 day/bar breakout alert
function preMain() {
setPriceStudy(true);
setShowTitleParameters( false );
setCursorLabelName("55 bar bo", 0);
grID = 0;
}
function main( )
{ // opening bracket
{
}
if(getBarState()==BARSTATE_ALLBARS)
{
xDaily_h = high(inv("D"));
xDaily_l = low(inv("D"));
var bint = false;
bar_counter = 0;
//a_highs = new Array(2,4,6,8,10);
}
if (bint == true)
{
bar_counter=0;
bint=false;
}
if (bar_counter > 50)
{
a_highs = new Array(a,b,c,d,e);
a_lows = new Array(v,w,x,y,z);
}
// load only at beginning of a bar
if (getBarState()==BARSTATE_NEWBAR)
{
bar_counter++;
a = xDaily_h.getValue(-1);
b = xDaily_h.getValue(-2);
c = xDaily_h.getValue(-3);
d = xDaily_h.getValue(-4);
e = xDaily_h.getValue(-5);
v = xDaily_l.getValue(-1);
w = xDaily_l.getValue(-2);
x = xDaily_l.getValue(-3);
y = xDaily_l.getValue(-4);
z = xDaily_l.getValue(-5);
//low_5daysdays= Math.min(v,w,x,y,z);
//high_3days = Math.max(a,b,c);
//low_3days= Math.min(x,y,z);
if ( a_highs != null);
{
//max_highs =33;
for ( i = 0; i< 3; i++)
{
//var v = a_highs[i];
if (a_highs[i] > high_3days)
high_3days = a_highs[i];
}
}
if ( a_highs != null);
{
//max_highs =33;
for ( i = 0; i< 5; i++)
{
//var v = a_highs[i];
if (a_highs[i] > high_5days)
high_5days = a_highs[i];
}
}
if ( a_lows != null);
{
//max_highs =33;
for ( i = 0; i< 3; i++)
{
//var v = a_highs[i];
if (a_lows[i] < low_3days)
low_3days = a_lows[i];
}
}
if ( a_lows != null);
{
for ( i = 0; i< 5; i++)
{
if (a_lows[i] < low_5days)
low_5days = a_highs[i];
}
}
} // end of current bar state
// start of after newbar
if( high(0) > high_3days)
{
myFlag = "Abv 3 D";
setBarFgColor(Color.black,0);
setBarBgColor(Color.RGB(192,255,160));
debugPrintln("ulow of 3 days =" + b + " bar counter " + bar_counter);
}
else if (low(0) < low_3days)
{
myFlag = "Blw 3 D";
setBarFgColor(Color.white,0);
setBarBgColor(Color.RGB(255,160,160));
//debugPrintln("downn");
}
else
{
myFlag = "Inside ";
setBarFgColor(Color.black,0);
setBarBgColor(Color.lightgrey,0);
//debugPrintln("Not up or down");
}
return new Array(myFlag);
} // closing bracket of main
// Supporting Functions
Comment