NexusFi: Find Your Edge


Home Menu

 





How to set values that Ninja Trader does not support.


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one CryptOrchid with 2 posts (0 thanks)
    2. looks_two aslan with 2 posts (4 thanks)
    3. looks_3 kenz987 with 2 posts (0 thanks)
    4. looks_4 roonius with 1 posts (3 thanks)
    1. trending_up 3,997 views
    2. thumb_up 7 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

How to set values that Ninja Trader does not support.

  #1 (permalink)
 CryptOrchid 
San Jose, CA
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation
Broker: Mirus/zen-fire
Trading: 6e, TF, CL
Posts: 2 since May 2010
Thanks Given: 2
Thanks Received: 0

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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Tao te Trade: way of the WLD
23 thanks
Diary of a simple price action trader
22 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
9 thanks
  #3 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5


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).

Reply With Quote
  #4 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

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.

Reply With Quote
Thanked by:
  #5 (permalink)
 
roonius's Avatar
 roonius   is a Vendor
 
Posts: 131 since Jun 2009
Thanks Given: 20
Thanks Received: 295

There is undocumented GetMinMaxValues method you can override:

 
Code
        public override void GetMinMaxValues(Gui.Chart.ChartControl chartControl, ref double min, ref double max)
        {
            base.GetMinMaxValues(chartControl, ref min, ref max); // here you get "real" min max values

            min = min - 10; // you can adjust min and max to your liking
            max = max + 10; //
        }

Reply With Quote
Thanked by:
  #6 (permalink)
 CryptOrchid 
San Jose, CA
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation
Broker: Mirus/zen-fire
Trading: 6e, TF, CL
Posts: 2 since May 2010
Thanks Given: 2
Thanks Received: 0

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?

Thanks
CryptOrchid

Started this thread Reply With Quote
  #7 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

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.

Reply With Quote
Thanked by:
  #8 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5

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.

Reply With Quote




Last Updated on May 14, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts