Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

seperate events for OnPriceChange and for OnBarClose bars

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

    seperate events for OnPriceChange and for OnBarClose bars

    Hello

    I have two separate independent logics which runs parallelly (interact through global vars) - one is based on OnBarClose and the other is base on OnPriceChange.
    is there is a capability to get a seperate callback for each of modes?
    or at least the ability to distinguish between the two modes entry in the OnBarUpdate() function..

    Thanks
    Oren
    Last edited by orenytz; 01-27-2018, 05:02 AM.

    #2
    Hello Oren,

    I'm not quite certain that I am following. A script's Calculate setting will affect all series that are added to the script..

    You can use the Calculate property within OnBarUpdate() if you would like.
    if (Calculate == Calculate.OnPriceChange)
    {
    // execute code
    }

    If you set Calculate to .OnPriceChange or .OnEachTick, you can trigger actions when a bar has closed by checking for IsFirstTickOfBar to be true. Then you can some actions occur when the price changes or a tick closes and do other actions after a bar has closed.

    Below is a publicly available link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      solved using IsFirstTickOfBar- detect end of bar.
      thank you !

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      69 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      42 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      24 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      27 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      54 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X