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

NT8 TickSize in BarsType Not Available

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

    NT8 TickSize in BarsType Not Available

    I am trying to access the TickSize variable in a custom BarsType in either the OnDataPoint or OnStateChange but both tell me it is not available in the context.

    How can I determine what the current instrument tick size is from within a custom BarsType or can I?

    #2
    Hello fxRichard, and thank you for your question.

    TickSize is a property of Indicators and Strategies. Further, the help guide cautions against using it in an Initialize() routine, which is evidence that this is an element that is not available until an Indicator or Strategy's OnBarUpdate method is called for the first time. Potential work-arounds such as the Instrument object have the same caution. Therefore, you will not be able to access this information at this stage.

    However, reviewing the source for @BarsTypes, Calculate methods take an argument Bars, which have a member Bars.Instrument.MasterInstrument . This, in turn, will have the members PointValue, which represents the price of a single point, and Round2TickSize, which takes a price as an argument and returns a number of ticks. These can be used together to determine how many ticks are in a point.

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, Today, 10:57 PM
    0 responses
    2 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    7 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Working...
    X