Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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?
Any help would be appreciated.
Thank you.
Can you help answer these questions from other members on NexusFi?
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.
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.
Thanks a lot @ratfink.
But my problem is that i need to get the SMA(5)[0] 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)[0] using reflection so that I can get double value for any indicator and easily compare them with any operator.
Simple answer - No, I've never used reflection, out of interest why do you need to? Are you programming outside of Ninja? Hopefully someone else can jump in with the torch.