Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
IntraBar Condition
Collapse
X
-
Gracias Brandon. solucioné el error usando otras condiciones. se puede cerrar el hilo
-
Originally posted by NinjaTrader_BrandonHHello manueldecastro,
Thanks for your post.
The condition you shared would correct to detect if the current Low price is less than the previous Low price.
That would also be correct logic for checking if the current High price is greater than the previous High price.
If the script has the Calculate mode set to Calculate.OnBarClose, the OnBarUpdate() logic will only process at the close of a bar.
To have logic calculate intrabar, you could set the Calculate mode to Calculate.OnPriceChange or Calculate.OnEachTick.
Calculate.OnPriceChange would have OnBarUpdate() logic process for each change in price. Calculate.OnEachTick would have OnBarUpdate() logic calculate for each incoming tick.
See this help guide page for more information about Calculate: https://ninjatrader.com/support/help.../calculate.htm
To understand how your logic is behaving, debugging prints need to be added to the script. Add prints one line above the conditions that print out all the values being used in the condition along with the Time of the bar. Prints will appear in a New > NinjaScript Output window.
See this NinjaTrader Support article for information about using Print() to understand the behavior of a script: https://support.ninjatrader.com/s/ar...nd-TraceOrders
Im working OneachTick.
Leave a comment:
-
IntraBar Condition
I need to make a condition for when the following is met.
A candlestick should have a lower low than the previous one and then have a higher high than the previous one.
I've tried the following code but it doesn't draw the signals for me correctly. Could you give me some ideas?
bool signal = false;
if (Low[0]<Low[1])
{signal = true;}
if (signal==true && High[0]>High[1])
{Draw.ArrowDown(this, @"Signal " + CurrentBar, false, 0, High[0]+2, Brushes.Blue);}
I need the signal to be drawn when the price goes down from low1 and then exceeds high1. The current candlestick may have made a higher high than high1 before dropping below low1.
Thanks!
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by futurenow, 12-06-2021, 05:49 PM
|
19 responses
995 views
0 likes
|
Last Post
![]()
by Redders
06-16-2025, 06:02 AM
|
||
Started by mathfrick2023, 05-08-2025, 12:51 PM
|
8 responses
103 views
0 likes
|
Last Post
![]()
by Yogaman
06-14-2025, 06:01 PM
|
||
Started by several, 04-22-2025, 05:21 AM
|
2 responses
274 views
0 likes
|
Last Post
![]()
by Lukasxgtx
06-13-2025, 06:00 AM
|
||
Started by NTEducationTeam, 06-12-2025, 02:30 PM
|
0 responses
40 views
0 likes
|
Last Post
![]() |
||
Started by NTEducationTeam, 06-05-2025, 09:43 AM
|
0 responses
122 views
0 likes
|
Last Post
![]() |
Leave a comment: