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)
Indi works on chart, not in Market Analyzer. Null ref check?
Guys this one has me scratching my head. Here is the guts of a simple indicator that takes today's Highs and Lows from IQFeed and plots them on a chart:
Nothing special, no errors. But when I try to use that indicator in Market Analyzer, I get the "Object reference not set to an instance of an object." error. Specifically:
I am sure I am missing something simple like a null ref check. Any suggestions?
Can you help answer these questions from other members on NexusFi?
The reason MarketData doesn’t work in the Market Analyzer is because this unsupported property is specifically programmed in a manner to be for charts only. To work around this you could try using these other unsupported properties: e.MarketData.DailyHigh.Price and e.MarketData.DailyLow.Price in the OnMarketData() method. Using it this way will only be applicable to real-time data going forward though.
Please find an attached sample of this combining both worlds with use of MarketData for the historical points on the chart, and the OnMarketData() usage for real-time and the Market Analyzer.
I needed something to alert me to session Highs and Lows so rewrote the default CurrentDayOHL indicator to add the options for audio alerts. Endgame is something for Market Analyzer but this should get me through today's trading.
It appears …
At present the user of that indicator gets his daily High and Low data via calculations done in Ninja that are reliant on Session Templates, and then an equivalence check is run to see if we are trading at the High or Low (if(Close[0]==DailyHigh[0]), for example) so you get an audio and/or visual alert in Market Analyzer.
I'm trying to add the option to use vendor-provided High/Low data instead of Ninja calculated High/Low data.
I think I need to functional equivalent of the GetCurrentBid() method, but where e.MarketData is DailyHigh or DailyLow. That could then be called in OnBarUpdate().
I'll dig out the C# book and have a look at creating two Custom methods, GetDailyHigh() and GetDailyLow().
If anyone thinks I'm approaching this the hard way I'm open to input! Thanks.
This appears to work for my purposes and doesn't throw exceptions when used in Market Analyzer:
I'll update the code in the other thread after a few more hours of testing. The High/Low alerts in Market Analyzer can now come from either Ninja calculated data or vendor provided data.