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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      51 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      142 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      275 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X