if (...)
{
_____;
_____;
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Email for order pending/fill/target/stop
Collapse
X
-
Originally posted by NinjaTrader_Josh View PostThis is a basic C# concept. The sample is correct because it is only doing one line of code for the if-statement. If you want to do multiple lines of code you need to use brackets.
Code:if (...) { _____; _____; }
Over and over again, Josh thx.
Comment
-
Originally posted by NinjaTrader_Bertrand View PostYou would need to work with IOrder objects for this, here's a sample demonstrating this - http://www.ninjatrader-support2.com/...ead.php?t=7499
I don't see anything in there that looks for Target1 or Stop1...
Comment
-
-
Originally posted by NinjaTrader_Josh View PostCorrect. That will be the method.
Just trying to print to the output window but it doesn't work:
// Print out some information about the target to the output window
string[,] orders = GetAtmStrategyStopTargetOrderStatus("TARGET1", "idValue");
// Check length to ensure that returned array holds order information
if (orders.Length > 0)
{
for (int i = 0; i < orders.GetLength(0) - 1; i++)
{
Print("Average fill price is " + orders[i, 0].ToString());
Print("Filled amount is " + orders[i, 1].ToString());
Print("Current state is " + orders[i, 2].ToString());
}
}
Comment
-
-
-
Changed it similar structure to the GetAtmStrategyEntryOrderStatus in the SampleAtmStrat:
// Check for a pending entry order
if (atmStrategyId.Length > 0)
{
string[,] orders = GetAtmStrategyStopTargetOrderStatus("Target1", atmStrategyId);
// Check length to ensure that returned array holds order information
if (orders.Length > 0)
{
for (int i = 0; i < orders.GetLength(0) - 1; i++)
{
Print("Average fill price is " + orders[i, 0].ToString());
Print("Filled amount is " + orders[i, 1].ToString());
Print("Current state is " + orders[i, 2].ToString());
SendMail("[email protected]", "[email protected]", "status", orders[i, 2].ToString());
}
}
}
In the log highlighted in yellow it says:
GetAtmStrategyStopTargetOrderStatus() method error: OrderName 'Target1' does not exist
I assumed since my ATM Strategy that is called has 2 targets it would automatically have Target1/Target2/Stop1/Stop2.
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 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
554 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