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 to set values that Ninja Trader does not support.
It seems like the minimum number of api's are exported, documented, and supported. Looking for some way to discover and access some of these values. Any hints or clues how to do this would be greatly appreciated.
I am trying to get the following functionality on NT7. I want to use the fixed scale so that the size of price bars do not change based upon the range of data on the screen. I also want to have the most current price in the middle of the chart.
This is easily achieved manually by using the fixed scale on the right scale and changing the scale min and max values. I want to create a simple indicator that updates the scale min and max values upon bar close.
So on bar close, I would calculate how much the min and max values need to change to keep the scale fixed but shift the price range to keep the close in the middle of the chart by setting min and max.
But I can not find an api for changing the min and max values for the price scale. Is there some way to discover or hack into NinjaTrader to accomplish this.
Thanks,
CryptOrchid
Can you help answer these questions from other members on NexusFi?
Look on the Ninja Trader forum for an indicator named VerticalScale (version 2) - It was written for 6.5, but the logic will probably work on 7 (maybe).
Well this has been hashed out on the NT forums, and of course since you are looking for a solution it was obviously not implemented.
In terms of API, I can not help you out, but if you check out the following NT Post, you will find a file called FixedScale.cs.
This indicator tries to implement fixed scale, but it has to do it by tricking NT (instead of calling an API). It does so, by using transparent drawing objects that set the autoscale, and these are placed in the Plot() routine. This is really just a hack, and was meant to show the NT guys how it could work, but it worked pretty well.
I have not used in a while, so not sure if it still works, but it might give you some ideas.
If I remember correctly, it does not center the last price, but instead tries to keep the last bar on the screen to maximize the amount of data that was kept on the screen. Probably could be changed to center if that is what you really wanted.
How I envision the code would work I would not only need to get the min/max values but I would also need to set them. Is there a call like base.SetMinMaxValues().
And the obvious questions is where are these undocumented calls documented? Or how would I explore what the undocumented calls are?
They are not documented (at least for us). We can not see all of the internal architecture and calls inside NT. Because the NT arch is extensible though, a certain interface is exposed and documented (what they call supported NinjaScript). Now there are also a number of routines that are called that are exposed name-wise, but are not supported, so are not externally documented. Some items fall in between (i.e. the bar formation code is exposed, but not really documented). If you are nice, and ask the right questions, NT guys will occasionally give you hints to get a little further. There are a lot of undocumented routines that you can find by using reflection to get the names of routines and the parms they take, but not knowing what they do makes it kind of trial and error.
For the min/max, you can not really set them per se, but instead set them by returning them in the Get() routine. Now that will only work, if NT always uses this routine to get the values.
Roonius: How do you find out these things? I have asked NT folks if there is any documentatin for developers and was told "NO". What amazes me is that each month they add several new developers with completed add-on systems to their approved list. But we struggle to get simple things done. Thanks, Ken.