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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X