This code works great:
protected override void OnBarUpdate()
{
Plot0.Set(EMA(21)[0]);
}
Now all I do is change the "[0]" to "[1]".
This code doesn't plot anything... just blank... not even a zero-line:
protected override void OnBarUpdate()
{
Plot0.Set(EMA(21)[1]);
}
why doesn't it plot anything?
------------------------------------------------------------------------------------------------------------
Question 2:
This code works great on "/ES 09-16" between 6AM and 2PM pacific time 8/19/16:
protected override void OnBarUpdate()
{
double v1;
if (EMA(21)[0] > 2178.5) {v1 = 1.0;} else {v1 = 0.0;}
Plot0.Set(v1);
}
Again, just change the "[0]" to "[1]" and, as expected...
This code doesn't plot anything... just blank... not even a zero-line:
protected override void OnBarUpdate()
{
double v1;
if (EMA(21)[1] > 2178.5) {v1 = 1.0;} else {v1 = 0.0;}
Plot0.Set(v1);
}
Now add in the ADX(14)[0] < 50 qualification to the if statement, and, voila...
This code works great:
protected override void OnBarUpdate()
{
double v1;
if (ADX(14)[0] < 50 && EMA(21)[1] > 2178.5) {v1 = 1.0;} else {v1 = 0.0;}
Plot0.Set(v1);
}
why does adding the "ADX(14)[0] < 50" clause suddenly perk it up again?
Comment