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?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to Print something just once in OnbarUpdate
Collapse
X
-
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?Tags: None
-
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.
Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mly916, Today, 09:48 PM
|
0 responses
10 views
0 likes
|
Last Post
by mly916
Today, 09:48 PM
|
||
Started by Mikey_, Today, 09:21 PM
|
0 responses
11 views
0 likes
|
Last Post
by Mikey_
Today, 09:21 PM
|
||
Started by cre8able, Today, 05:53 PM
|
3 responses
13 views
0 likes
|
Last Post
by cre8able
Today, 09:20 PM
|
||
Started by Aryan Kumar, Today, 09:04 PM
|
0 responses
4 views
0 likes
|
Last Post
by Aryan Kumar
Today, 09:04 PM
|
||
Started by yertle, Yesterday, 05:49 PM
|
3 responses
16 views
0 likes
|
Last Post
by Mindset
Today, 08:38 PM
|
Comment