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 Radano, 06-10-2021, 01:40 AM
      19 responses
      604 views
      0 likes
      Last Post Radano
      by Radano
       
      Started by KenneGaray, Today, 03:48 AM
      0 responses
      3 views
      0 likes
      Last Post KenneGaray  
      Started by thanajo, 05-04-2021, 02:11 AM
      4 responses
      470 views
      0 likes
      Last Post tradingnasdaqprueba  
      Started by aa731, Today, 02:54 AM
      0 responses
      5 views
      0 likes
      Last Post aa731
      by aa731
       
      Started by Christopher_R, Today, 12:29 AM
      0 responses
      10 views
      0 likes
      Last Post Christopher_R  
      Working...
      X