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