I am creating my strategy. After my coditions are true I want to place a stop order to open transaction but with time limit. The order must be valid only one bar after conditions are true. I don't know how to do that. Can I do that in strategy wizard? If yes, can you help me?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Orders with time limit
Collapse
X
-
Orders with time limit
Hello,
I am creating my strategy. After my coditions are true I want to place a stop order to open transaction but with time limit. The order must be valid only one bar after conditions are true. I don't know how to do that. Can I do that in strategy wizard? If yes, can you help me?Tags: None
-
Hello DanielJ,
This is the default behavior for stop orders. They are cancelled if they are not filled on the bar they're submitted on.
If you wanted to change this behavior and issue cancel commands manually, you must work with code and this is considered advanced programming. A sample on this is available here:
Strategy: Using CancelOrder() method to cancel ordersRyan M.NinjaTrader Customer Service
-
Ok,
can you help me with this. I have created simply strategy based on insidebar and violating high of the insidebar. After violating I want to open stop order one tick above high of the insidebar. The problem is the orders aren't place but they should be.
This is the code of this simply strategy.
This is the code:
protected override void Initialize()
{
SetStopLoss("", CalculationMode.Ticks, 100, true);
SetProfitTarget("", CalculationMode.Ticks, 100);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (High[1] < High[2]
&& Low[1] > Low[2])
{
EnterLongStop(DefaultQuantity, High[1] + 1 * TickSize, "");
}
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
77 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
45 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
27 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
63 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment