I like using ExitLong(...) method overloads without a quantity so that the NT8 execution engine knows to exit either my entire position, or my entire position that was entered with an entry order having a certain signal name, regardless of the number of entry orders and their signal names, and regardless of the number of exit orders already executed as part of my scaling out logic.
The problem is that the only ExitLong(...) method overload that accepts a parameter for "barsInProgressIndex" also requires that "quantity" be provided as well.
The list of ExitLong method overloads is displayed on this page: https://ninjatrader.com/support/help...s/exitlong.htm
Here is the only ExitLong method overload that accepts "barsInProgressIndex":
ExitLong(int barsInProgressIndex, int quantity, string signalName, string fromEntrySignal)
Is it safe, and is it the best possible solution, to pass a value of int.MaxValue as the value for the "quantity" parameter into this method overload in order to safely exit out of either 1) an entire position or 2) the entire position whose entry order had a specific signal name, as the following two method calls demonstrate?
// Flatten only the part of the position whose entry order had a signal name of "SignalNumber8", for the instrument whose "barsInProgressIndex" is 1.
ExitLong(1, int.MaxValue, "ExitSignal14", "SignalNumber8");
// Flatten the entire position for the instrument whose "barsInProgressIndex" is 1, by using "" for the entry signal name.
ExitLong(1, int.MaxValue, "ExitSignal14", "");
Thank you for your help,
EquityTrader
Comment