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 Skifree, Yesterday, 11:38 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Mathias79, Today, 10:38 AM
            6 responses
            18 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by eladlevi, Today, 11:02 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by Skifree, Yesterday, 11:41 PM
            2 responses
            13 views
            1 like
            Last Post eDanny
            by eDanny
             
            Started by TraderCro, 04-12-2024, 11:36 AM
            8 responses
            105 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X