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 CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
27 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
20 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
183 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
335 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
260 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment