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)
Yes and no. Yes, calling the given code will cause a refresh. No, because bars are not updated yet (OnMarketData is called before OnBarUpdate). So if you intention is to update based on the bars, you are out of luck, but if you had a custom plot method that was plotting a text item or placing a line based on some other internal var that was updated in OnMarketData, that would work. Hopefully, I am conveying the concept.
Not sure what you mean by volume. The volume updates with each call to OnBarUpdate, so not sure why you need OnMarketData for that. Perhaps you mean the bid/ask sizes.
This is my first indicator and I simply added your 3 lines into standard ninja script indicator file, will this work? (did it just now and markets are calm and I cannot see any higher cpu usage so I´m wondering if I´m right).
Elite Membership required to download: NullLatency.zip
The code needs to go in the OnBarUpdate() method, not Initialize(). Also, make sure CalcOnClose is set to false, or it will only be called at the end of the bar.
Also, if there is nothing going on, you are not going to notice any difference. This code will make little or no difference for 99% of indicators. The NT update interval of .1 s is essentially 10 frames per sec, which is not real fast, but when you think about what you need to see on a chart and how fast you can interpret the info, it is generally fast enough. There are a few indicators (i.e. level2) which do benefit from this code, but you will incur the extra CPU cycles of doing extra screen updates.
The reason people get in trouble, is they think they need all of their charts/indicators to update every tick. This just is not the case.
I think this issue is relevant and should be known:
Maximum frequency of updates to OnMarketData/Depth No3 - NinjaTrader Support Forum (
, I don´t want to spam the board but for me it´s very important that there comes pressure to Zenfire to deliver what they promise: unfiltered ... therefore I make several posts).
As mentioned before in other threads as I´m no programmer I can only believe when I´m told that I receive complete tape an no fragments. We´ll se what they answer, I asked already Mirus to check about, they told me they ask Zenfire techs - would be great if other could give information, too.