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 Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      4 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X