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 kevinenergy, 02-17-2023, 12:42 PM
          118 responses
          2,777 views
          1 like
          Last Post kevinenergy  
          Started by briansaul, Today, 05:31 AM
          0 responses
          6 views
          0 likes
          Last Post briansaul  
          Started by fwendolynlpxz, Today, 05:19 AM
          0 responses
          4 views
          0 likes
          Last Post fwendolynlpxz  
          Started by traderqz, Yesterday, 12:06 AM
          11 responses
          28 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by PaulMohn, Today, 03:49 AM
          0 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Working...
          X