What instrument, period, and days loaded are you using?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Execution
Collapse
X
-
I didn't know what instrument so I used daily bars for the ES 12-13 contract and did see
Condition is Satisfied get printed to the output window just once. When I removed the boolean it printed three times.
Does your output window not print this message? If not what instrument are you using?
Also note, no trades were generated because limit orders will expire at the end of the next bar if not filled.LanceNinjaTrader Customer Service
Comment
-
Hi Lance,
Thanks a lot for your help and your efforts. I dont know why its not working in my PC. And instead of that I want to write the code for multi time frame strategy.
I would like to enter a position based on a 1-minute chart, but only if conditions on a One-day time frame chart are met.
In this strategy I am not understanding where to place the BarsInProgress==0 and BarsInProgress==1 . Even I have read the help guide. So please can you edit in the strategy. Then I will get the total exposure. Please see the code and edit it.
protected override void Initialize()
{
CalculateOnBarClose = true;
Add(PeriodType.Day, 1);
SetProfitTarget("", CalculationMode.Percent, 0.01);
SetStopLoss("", CalculationMode.Percent, 0.01, false);
}
protected override void OnBarUpdate()
{
if ( Close[0] > Closes[1][0] * (1 + 0.0025) && CrossAbove(RSI(BarsArray[1], 10, 3), 30, 1))
{
EnterLongLimit(100, GetCurrentBid(), "");
}
}
Thanks
Imran.
Comment
-
You could insert this at the start of your OnBarUpdate()
if(BarsInProgress != 0)
return;
If you're interested in more in depth learning on NinjaScript we also offer premium education classes here: http://www.ninjatrader.com/PremiumEducation.php
Let me know if I can further assist.LanceNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 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
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment