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

Get half tick

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

    Get half tick

    Hi there
    I am using ninja trader 8. Is there any way to get 1 and half tick in an instrument? for example i want to know if the price is above a constant value for 1 and half of tick or less than a constant value for 3 quarter of a tick.

    #2
    Hello amiralimadadi,

    Thanks for your inquiry.

    TickSize can be used to get instruments tick value. If I am understanding your inquiry correctly, you could perform math similar to the following: MyConst * (1.5 * TickSize) and compare against a Price Series.

    Publicly available documentation can be found below.

    TickSize - https://ninjatrader.com/support/help.../?ticksize.htm

    Price Series - https://ninjatrader.com/support/help...ice_series.htm

    Please let us know if we can be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      I guess i could not explain the problem well.
      Suppose that you have a series and the strategy tells you that if the price is upper than a value (for example 114.4123) for 2 ticks, you should enter trade. It's OK. In OnBarUpdate you can check Close[0] and Close[1] and if they both are upper than that value you enter the trade.

      But my strategy says that if the price is upper than a value for 1.5 tick, enter the trade. I want to know how to catch 0.5 tick? Is OnBarUpdate a good event for this? Should i change the event ? or anything else.

      thank you and sorry for long question

      Comment


        #4
        Isn't there anybody who know the answer? It is important to me

        Comment


          #5
          Hello amiralimadadi,

          Ticks are the smallest amount of market movement and OnBarUpdate() is event based rather than being time based. We could not wait for one and a half ticks to pass, because OnBarUpdate() will only update with as ticks come in, and we cannot see "half ticks."

          If you are looking for time based events that can happen at your own interval, you could add a timer and attach your own event handler with TriggerCustomEvent() to handle your own time based events. An example implementing a timer with an event handler and TriggerCustomEnevt() can be found below. Please also the reference the associated documentation with this sample for a complete understanding.

          SampleCustomEvent - https://ninjatrader.com/support/foru...ead.php?t=5965

          Please let us know if you have any questions.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          12 views
          0 likes
          Last Post DanielSanMartin  
          Started by DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          11 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          7 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Working...
          X