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 wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      27 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 04-23-2024, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      193 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,235 views
      0 likes
      Last Post xiinteractive  
      Working...
      X