• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Print something just once in OnbarUpdate

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

  • NinjaTrader_ChelseaB
    replied
    Hello Boonfly8,

    You would need to control this in the logic of the script. I would recommend using a bool (that can be flipped back to true on a new bar on bar close or on the first tick of a new bar)

    Below is a public link to an educational site that demonstrates using a bool.
    https://www.dotnetperls.com/bool

    Leave a comment:


  • Boonfly8
    started a topic How to Print something just once in OnbarUpdate

    How to Print something just once in OnbarUpdate

    I have something where if the trade makes $100, it will return to the onBarUpdate method and essentially quit. In the same if statement I also print the time and some text like "Pnl Target Hit".

    How do I only print that once? when the pnl hits I don't want it to keep printing via every onBarUpdate. Is there a system.exit function in NT8?

Latest Posts

Collapse

Topics Statistics Last Post
Started by jcbnoles, Today, 12:18 PM
0 responses
1 view
0 likes
Last Post jcbnoles  
Started by stafe, Today, 11:57 AM
1 response
2 views
0 likes
Last Post NinjaTrader_Jim  
Started by tvaughan4, Today, 11:01 AM
3 responses
9 views
0 likes
Last Post tvaughan4  
Started by Branpo, Today, 10:51 AM
3 responses
13 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by fourpeaks99, Today, 10:51 AM
2 responses
7 views
0 likes
Last Post fourpeaks99  
Working...
X