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 Radano, 06-10-2021, 01:40 AM
            19 responses
            606 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            4 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            470 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by aa731, Today, 02:54 AM
            0 responses
            5 views
            0 likes
            Last Post aa731
            by aa731
             
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            11 views
            0 likes
            Last Post Christopher_R  
            Working...
            X