Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

function OnPriceChange?

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

    function OnPriceChange?

    Hi NT friends


    OnBarupdate its a necesary function but update so many times.

    I need a function that update only when the chart price move or change.

    Exits?

    Thank you !

    #2
    Hello,
    There is not an OnPriceChange() event. The closest is the OnMarketData() event method.
    OnMarketData() is called for every change in level one market data for the underlying instrument. This can include but is not limited to the bid, ask, last price and volume.
    with OnMarketData you could have a double variable to track the current price and trigger an if statement if that price no longer matches
    For more information on the OnMarketData() please see the following link: http://ninjatrader.com/support/helpG...marketdata.htm

    If you like I could submit a feature request to add in a method that would handle OnPriceChange.
    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      double price; <= in variables section

      if (!FirstTickOfBar && price == Close[0]) <= top of OnBarUpdate section
      return;
      price = Close[0];
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      656 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X