Shared Static Class can save lots of resources

Just wanted to share as this is not a common programming pattern we see with free indicators/code. In this example I have a single ‘producer’ indicator that shares data with ‘consumer’ indicator (the volume profile). If you have many volume profiles, this saves a lot of RAM, CPU, and most importantly shortens NT8 thread execution time (avoiding bottlenecks), while making indicator loading instant. In this example I copy the window and new window does not load data, just draws immediately because ‘producer’ holds data for it.

The ‘Producer’ indicator is not shown, both windows have ‘consumer’ indicators that access producer’s shared static class, buys/sells at tick resolution, and calculate their own bar indexed data for rendering and stats.

staticClass

.

2 Likes

This is a nice one ,

1 Like

Thanks. I really like the adjustable range volume profiles. It can basically reply how market behaved, bar-by-bar:

rangeVP2

rangeVP1

Let me see what I can come up with, I will start messing around with it now.

Looks great, I like everything about it.

Here’s VP heatmap, unlimited bar or volume highlights:

rangeVP3

I did it as a Drawing Tool manually place it anywhere on the chart, drag it, resize it, and add multiple copies.
and Indicator so it can stay active on the chart and automatically updates while live market events occur. I also added a check box so it can start whenever I place it and it will auto spread to the current candle,

@BillMilton The heat map on it looks pretty cool,

A problem with the drawing tools is that they cannot use secondary data series. Are you loading tick data via BarsRequest()?

I will now have to upgrade the lines also so it can fully match now, I’ll keep working on it to see if I can do better

Looks sharp. One note, your heatmap is of whole VP, where as the one I’ve shown is of (increasingly larger) layers of rolling volume from End Anchor. Overlay of VP of 10000, 20000, 50000, 1000000, 200000 rolling volumes in the example.

1 Like

Now I am curious how vertical gradient would look like. Gradient scaled not by pixel distance but volume at level. This way colors would reveal strength of each node, no matter how it’s scaled.

1 Like

Ive actually done that and it’s not bad ,

Looks interesting. Highlight needs it’s own gradient, distinct from the main VP.

agree the option is there to do so , I’m also planning on adding like three different color templates, in case they need eye safe color or if they need hard core red and green colors lol, :grinning_face:

Hi, How can I test this?

Can I use the Shared Static Class indicator to make the indicators I use work faster? I use Volume Profiles, Opening Ranges and VWAPs. If I download the Shared Static Class indicator, will it speed-up these other indicators? I am tired of the “Loading” and “Calculating” messages locking up my charts.

Indicators you mention could be coded using shared static class, but your current indicators will not work w/o changing their code.

1 Like

what else do u have in mind of messing around with ?

lmao , ok ok I will stop messing around now, no more spamming this chat for me

This was discussed in the old 30 year-old ninjatrader forum, in depth, and I think everyone should reach out to Ninja Trader (email them) to provide a way to access to old forum. Or at least integrate the old forum into the new forum. Because rediscovering things like this, is gonna take another 30 years.

1 Like

yes, I truly agree, no one likes to walk backwards,