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 r68cervera, Today, 05:29 AM
    0 responses
    2 views
    0 likes
    Last Post r68cervera  
    Started by geddyisodin, Today, 05:20 AM
    0 responses
    3 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    34 views
    0 likes
    Last Post JonesJoker  
    Started by GussJ, 03-04-2020, 03:11 PM
    12 responses
    3,239 views
    0 likes
    Last Post Leafcutter  
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    6 views
    0 likes
    Last Post AveryFlynn  
    Working...
    X