Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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​
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by xiinteractive, 04-09-2024, 08:08 AM
        2 responses
        10 views
        0 likes
        Last Post xiinteractive  
        Started by Irukandji, Today, 09:34 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by RubenCazorla, Today, 09:07 AM
        1 response
        5 views
        0 likes
        Last Post RubenCazorla  
        Started by TraderBCL, Today, 04:38 AM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by WeyldFalcon, 08-07-2020, 06:13 AM
        11 responses
        1,423 views
        0 likes
        Last Post jculp
        by jculp
         
        Working...
        X