Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access to NinjaTrader.NinjaScript.BarsTypes object from ChartStyle object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Access to NinjaTrader.NinjaScript.BarsTypes object from ChartStyle object

    Hello.

    I have custom BarsTypes (say, NinjaTrader.NinjaScript.BarsTypes.MyBarType)and custom ChartStyle (say, NinjaTrader.NinjaScript.ChartStyles.MyChartStyle).
    I want to create public properties in MyBarsType to access them from MyChartStyle.



    Why do I need this: MyChartStyleshould paint bars according to internal data of MyBarsType.
    Why do I suppose it is possible: both instances run on same chart.
    Last edited by fx.practic; 04-03-2020, 01:27 PM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    This works, but, is this legal and safe?
    PHP Code:
    BarsTypes.MyBarsType my_bars chartBars.Bars.BarsSeries.BarsType as BarsTypes.MyBarsType;
    if( 
    my_bars!= null )
    {
         Print( 
    my_bars.Test_Prop );

    Last edited by fx.practic; 04-03-2020, 12:36 PM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    Comment


      #3
      Hello fx.practic,

      Thanks for your question.

      This is essentially how the Volumetric Bars are referenced in a script to use their data access methods, and I would recommend the same for this case.

      I can't give specifics on how the data access methods are implemented in the Volumetric Bars as they are proprietary and closed source, but the fact that this BarsType offers additional public properties, and these properties are referenced the same way you are should give you enough confidence to move forward with what you are doing.

      For the thread's reference Volumetric Bar Data Access methods can be referenced here - https://ninjatrader.com/support/help...tric_bars2.htm

      I look forward to assisting.
      JimNinjaTrader Customer Service

      Comment


        #4
        Thank you, Jim.
        Now, after your confirmation, I feel much more confident.
        NT is highly flexible.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        19 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X