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)
I am using the VPA indicator, I want to reference a divergence plot I have added , I want a new plot that seeks a divergence within 5 bars and now a moving average crossover.
Getting error below when trying to use MRO for referencing a condition :
The best overloaded method match for 'NinjaTrader.NinjaScript.NinjaScriptBase.MRO(Syste m.Func<bool>, int, int)' has some invalid arguments
Argument 1: cannot convert from 'bool' to 'System.Func<bool>'
Trying to add divergence breakout plots to the open source VPA new version, tried using MRO as in User Guide and this way with no success , any pointers/fixes greatly appreciated.
So MRO returns a int value of the number of bars ago the specific condition happened within the lookback. Note MRO always starts with the CurrentBar and works backward through the lookback, so in your code it is looking back 21 bars-including the currentbar.
If the condition did NOT occur within the lookback, it returns a -1, it DID occur it will return the #barsago it most recently occurred (since the 2nd parameter is a 1)
So first question is what kind of variable is RSIPosDvg? Is true or false, or a numeric, or ??
For the MRO to work, the expression must be in the form of a condition that is true of false. If it is numeric, we just have to express it in the MRO as a condition that it can resolve to true or false.
Second, to use MRO in this situation, you also must express the MRO in terms of its return value of -1, or n# barsago most recently the condition was true (the "1" in the second parameter means most recent, 2 would be the 2nd most recent, etc.
So, in your code, I assume you want the RSIPosDvg "condition" to have occurred at least once in the CurrentBar + 20 prior bars, so check that it didn't eval to a "-1" (any positive return value means it DID occur)
Thanks! Attached is what I have so far, it has over 100 plots/alerts to choose from, I added my interpretation of Bag Holding and End Of A Rising market, the divergence breakout section has not been corrected yet, I plan to add the Bollinger W , V, M, and A top/bottom formation alerts before sharing to the downloads section.