Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-instrument issue

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

    Multi-instrument issue

    I have an indicator running in 15 seconds chart that draws a signal when conditions are met in primary Bars or in secondary Bars. It works perfecly OnBarClose.

    But I need the indicator run OnEachTick, and in this case, there are situations where signals of secondary series are duplicated, they appear in the bar where conditions are met and also in the next one.

    I suppose the problem is that primary bars have started and there is not a first tick in secondary yet, so the code takes last close bar data

    What would be a good approach to wait that secondary bar starts?

    Thanks a lot
    Last edited by Impeesa; 10-07-2020, 01:40 AM.

    #2
    Hello Impeesa,

    Thanks for your post.

    When using Calculate.OnEachTick, or Calculate.OnPriceChange, you can use IsFirstTickofBar if you want to have some processes performed only once per bar.

    Reference: https://ninjatrader.com/support/help...ttickofbar.htm

    I do not know if this will solve the issue but wanted to let you know that is something available.

    Otherwise, you may need to create logic (in the form a bool variable) where the bool is set when the condition to draw the object is true and then once drawn is set to false to prevent drawing again until some other condition resets the bool back to true when you are ready to draw again.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, Yesterday, 10:06 AM
    0 responses
    17 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    16 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    14 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    9 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    36 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X