I am developing a custom indicator and keep hitting a brick wall .
Could you clarify the arguments for CrossBelow(); please?
This won't work:
if(CrossBelow(Stochastics(3,14,7).K[0],Stochastics(3,14,7).D[0],0)) SScrossDown=true; // test1
it simply won't compile, something about overload methods and arguments, and yet this WILL compile:
if (CrossBelow(EMA(20),Stochastics(3,14,7).D[0],0)) SScrossDown=true; // test2
and so will this:
if (CrossBelow(Stochastics(3,14,7).K[0],EMA(20),0)) SScrossDown=true; // test3
and this works OK too:
if (CrossBelow(EMA(10),EMA(20),0)) SScrossDown=true; // test4
Note that as far as the documentation for V6.5 (and I am using V6.5.1000.1 with .NET V2.0.50727.42) is concerned both of the first two arguments for CrossBelow can be either IDataSeries or numeric so all of the above examples should work including test1.
Is it a bug in NinjaTrader software? Or am I missing something after all?
Ideally I would like to be able to do the following:
// ideal code fragment
double StochVal=Stochastics(3,14,7).K[0];
double StochMA=Stochastics(3,14,7).D[0];
if (CrossBelow(StochVal,StockMA,0)) SScrossDown=true;
because this way I can call Stochastic only twice and then use the results in the rest of my code many times over. But I can't use the above code fragment because it doesn't compile either!
Any help much appreciated,
MarkB
Comment