Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print only once "onBarUpdate"

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

    Print only once "onBarUpdate"

    Hi
    I have a custom indicator that is calculated OnEachTick. If a condition is met, The indicator prints a statement to the output window. Because it is calculated onEachTick, it iteratively prints the statement as long as the condition is met during the bar duration. Is there any trick to make the script print only once if the condition is met?
    Thank you for your support.

    #2
    Hi MSerag, thank for writing in. There is a technique where you keep track of the current bar being processed. I have an example of this here in the builder. You can unlock this code to see how it works in C#:

    Hi, I'm currently working on a strategy that is utilizing OnTickChange data using the linked method. I am using a Tick Chart. The strategy uses onTickChange to make intrabar entry, and does so fine with the Set1 and Set2, but if/when profit target is hit, it will submit another order after the profit target if the


    Kind regards,
    -ChrisL​

    Comment


      #3
      Hi Chris, the link guided me to CSS Examples response where I could not find the code. Would you please check whether this is the correct link? Thank you.

      Comment


        #4
        Hi MSerag, please see post Number 9 on that link that I sent earlier.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        51 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        31 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        165 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        100 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        160 views
        2 likes
        Last Post CaptainJack  
        Working...
        X