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 RookieTrader, Today, 07:41 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by kujista, Today, 05:44 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by elderan, Yesterday, 08:03 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by samish18, Yesterday, 08:57 AM
        8 responses
        25 views
        0 likes
        Last Post samish18  
        Started by DJ888, 04-16-2024, 06:09 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X