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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X