How can I check the condition for =,!=,>= and <= in NinjaTrader.Indicator.Indicator class? I have done > and < with
1. CrossOver(IDataseries,IDataseries,value) // for >
2. CrossBelow(IDataseries,IDataseries,value) // for <
Is there any methods to check in case we need to check with =,!=,>= and <= operators?
You can still use the '==', '<=' and '>=' operators on indicator or series results (i.e. with a [bar] suffix) directly, just remember that the tests will not be much extra use unless you use some form of rounding (e.g. TickSize, integer) and/or the value differences are meaningful when tested at that granularity.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
So you can see equality testing will not spot all crossovers, in this case we are using rounding but if we don't do that then we would still have floating point representation issues. Different horses for different courses.
Zip file for code attached.
Last edited by ratfink; December 2nd, 2014 at 04:19 AM.
Thanks a lot @ratfink.
But my problem is that i need to get the SMA(5) through reflection with methodinfo.invoke.
Here is my code :
dataSeries1 = (IDataSeries)ind1_methodInfo.Invoke(obj, ind1_params);
dataSeries2 = (IDataSeries)ind2_methodInfo.Invoke(obj, ind2_params);
The above code calls like SMA(5) which returns Dataseries.
Do you have any idea to invoke a method which have indexer ie, call SMA(5) using reflection so that I can get double value for any indicator and easily compare them with any operator.