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

Ticks and Prices and Offsets

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

    Ticks and Prices and Offsets

    Hello,

    Can you tell me, is it possible for NinjaScript code to know how many decimal places are in the price of an instrument?

    And what the tick value is?

    Example: If I have a general strategy or indicator and I want to input a parm value that indicates a tick offset to the price. The offset is an integer.

    But, in order to apply the offset to an instruments price, I need to know the tick precision (decimal places) and the value of each tick.

    So, to add 5 ticks to the FDAX, for example, the price would move 2.5 cents, because each tick is worth .5 cents.

    Look at 6J...with all those decimal places.

    Perhaps another way to ask this...is how to add a certain number of ticks to a price to come up with the new price? Is there an easy way?

    New Price = Old Price + (tick-offset * value per tick)?? thinking out loud.

    Or, am I missing something? (newbie)

    Thanks

    #2
    Hi Turtle Trader,

    You can access the tick size with "TickSize", and multiply it as needed.

    More info at - http://www.ninjatrader-support.com/H....html?TickSize
    TimNinjaTrader Customer Service

    Comment


      #3
      reply

      perfect!

      that will work.

      Comment


        #4
        ticksize not in context

        I"m trying to accress ticksize in OnBarUpdate()

        and get the message "The name 'ticksize' does not exist in the current context"
        -----------------------------------------------

        code:

        double tx;
        tx = ticksize + 0;

        --------------------------------------------

        please advise.

        Comment


          #5
          Hi Turtle Trader,

          The correct syntax is "TickSize" without the quotations.

          Like all C# code, it is case sensitive.
          TimNinjaTrader Customer Service

          Comment


            #6
            que tonto!

            you're right...thanks

            never coded C or C# before...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            6 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
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            6 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Working...
            X