Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
limit order
Collapse
X
-
mballagan,
To cancel orders you want to use CancelOrder() on the IOrder for the order. http://www.ninjatrader-support.com/H...ncelOrder.htmlJosh P.NinjaTrader Customer Service
-
limit order
Thanks for the info.
If we look at the sample code:
private IOrder myEntryOrder = null;
private int barNumberOfOrder = 0;
protected override void OnBarUpdate()
{
// Submit an entry order at the low of a bar
if (myEntryOrder == null)
{
myEntryOrder = EnterLongLimit(0, true, 1, Low[0], "Long Entry");
barNumberOfOrder = CurrentBar;
}
// If more than 5 bars has elapsed, cancel the entry order
if (CurrentBar > barNumberOfOrder + 5)
CancelOrder(myEntryOrder);
}
After the CancelOrder will myEntryOrder == null?
Comment
-
limit order
In the following code snippet I enter a longlimitorder:
if(LongTrigger && CurrentBar == longorderbar)
{
LongOrder = EnterLongLimit(Open[0]+ TickSize*4,"LongEntry");
SetStopLoss("LongEntry",CalculationMode.Ticks,10,true);
SetProfitTarget("LongEntry",CalculationMode.Ticks,10);
}
If the price falls to a certain level I want to cancel the order if not filled is this the correct approach?
if(Close[0] < pricelevel)
{
CancelOrder(LongOrder);
}
even if order not filled?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rexsole, Today, 01:46 PM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by rexsole
Today, 01:46 PM
|
||
Started by dRun22, Today, 09:43 AM
|
3 responses
28 views
0 likes
|
Last Post
|
||
Started by HandsFreeTrader, 06-28-2023, 07:38 AM
|
4 responses
202 views
0 likes
|
Last Post
![]()
by uchauhan
Today, 01:07 PM
|
||
Started by gambcl, Today, 11:39 AM
|
2 responses
16 views
0 likes
|
Last Post
![]()
by gambcl
Today, 12:50 PM
|
||
Started by brucerobinson, Today, 12:14 PM
|
0 responses
10 views
0 likes
|
Last Post
![]() |
Comment