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 bortz, 11-06-2023, 08:04 AM
      47 responses
      1,607 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      15 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X