Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Intrabar Signal Analysis - Single Output When True
Collapse
X
-
Intrabar Signal Analysis - Single Output When True
Hi, I have a question regarding evaluating a signal intrabar but preventing that signal from re-outputting a true signal (if this makes sense?). Currently I am calculating OnPriceChange and would prefer to keep the OnPriceChange evaluation method but would like it signal only one time. I.e. using OnPriceChange -> if xxx is true, output. When price changes xxx is evaluated again but if true again, do nothing. Any chance there's an example or method of something like this?Tags: None
-
Hello itsthefriz,
Thank you for your note.
To clarify, you want the signal to be generated once per bar, intrabar using OnPriceChange to calculate, is that correct?
You could create a bool variable and call it something like SignalGenerated. Within your condition block that triggers the signal, check that SignalGenerated is false before actually generating the signal, and if it's false, set SignalGenerated to true, and output your signal. Then, reset the signal on the first tick of the next bar using IsFirstTickOfBar:
private bool SignalGenerated = false;
if (IsFirstTickOfBar)
{
SignalGenerated = false;
}
if (your conditions to generate signal && SignalGenerated == false)
{
SignalGenerated = true;
// generate your signal here
}
Please let us know if we may be of further assistance to you.
-
Ah, that's a great idea setting up a bool signal to prevent it from constantly evaluating, thank you for the help!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment