Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using calculate=eachtick strategy at stocks

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

    Using calculate=eachtick strategy at stocks

    hi,
    My current strategy is using CALCULATE= each tick - i use it for NQ 03-24 instrument.

    futures use TICK by tick methods.

    ----
    But If i want to use this code for STOCKS like AAPL, META, GOOGL

    then how this tick based code works?

    I am confused, because stocks move cent by cent. Example- aapl will move from 119.21 to 119.22


    --
    so, what should I do?

    #2
    Hello manitshah915,

    Tick has two meanings here.
    A tick can be a Last update coming from the market. The Calculation setting can be set to update for every Last market data update (or tick).
    A tick can also be the minimum price fluctuation. The ES has a tick size of .25. A stock has a tick size of .01.

    In historical, TickReplay is necessary to use Calculate.OnEachTick or .OnPriceChange. This requires historical tick data (such as from Kinetick or IQFeed, or imported from file).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      so, if i want to use this on each tick code - for stocks

      then I need to write down- on price change at calculate= section

      am i right?


      ---

      what happens,

      if I use current- on each tick code at apple stock?

      how will that behave?

      will code check condition on each 0.01$ move?

      Comment


        #4
        Hello manitshah915,

        No, Calculate.OnEachTick works the same for equities as it does for futures and forex.

        "if I use current- on each tick code at apple stock?"

        In realtime, or with TickReplay in historical, this will trigger OnBarUpdate() for every received tick (meaning Last market update), exactly the same as it would for the ES 03-24.

        If you wanted to check the current price has changed by 1 tick, on any instrument type, you can save the current price to a variable and then on future bar updates check if the price is greater or less than the variable.

        private double lastPriceSaved;

        In OnBarUpdate():

        if (Close[0] - lastPriceSaved == TickSize)
        {
        // price has increased by 1 tick exactly
        }

        if (Close[0] - lastPriceSaved > TickSize)
        {
        // price has increased by more than 1 tick
        }

        if (Close[0] != lastPriceSaved)
        {
        Print(string.Format("{0} | price has changed by {1} ticks", Time[0], (Close[0] - lastPriceSaved) / TickSize)); // print the amount of ticks the price has changed
        lastPriceSaved = Close[0]; // save the current price to the variable for the next update to compare
        }
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X