Thanks
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Close By Stop Loss
Collapse
X
-
Hello kiss987,
Thank you for writing in. You can know how a position was closed by checking the Name column and the Filled column of the orders tab of either the control center or the strategy analyzer (depending on how you are running your strategy). You will see "Stop loss" as the name, and an amount greater than 0 in the "Filled" column indijcating that a position was exited through the SetStopLoss() method.
More information on the SetStopLoss() method can be found in our help guide here: http://ninjatrader.com/support/helpG...ub=setstoploss
If you need to know if your position was closed by the order placed from the SetStopLoss() method in code, it could look something like this:
Code:protected override void OnExecution(IExecution e) { if(e.Order != null && e.Order.OrderState == OrderState.Filled && e.Order.Name.ToString() == "Stop loss") { //Do something } }
More information on the OnExecution() method can be found in our help guide here: http://ninjatrader.com/support/helpG...ub=onexecution
Please let us know if we may be of further assistance.Michael M.NinjaTrader Quality Assurance
-
Hello,
When using SetProfitTarget() it will have a default name of ProfitTarget.
EnterLong and ExitLong do not have default names but you can name them by entering a string in between the parantheses.
Code:EnterLong("My Long Order" + CurrentBar);
If we can be of any other assistance please let us know.Cody B.NinjaTrader Customer Service
Comment
-
Hello,
Please see the following example below using ExitLong.
Code:ExitLong("My Long Order" + CurrentBar);
If we can be of any other assistance please let us know.Cody B.NinjaTrader Customer Service
Comment
-
Hello,
The fromEntrySignalName would need to be identical to the value that you use in EnterLong().
If you do not it would end up with exiting by submitting long market orders until your position is flat.
I recommend reviewing the Tips subsection for this on ExitLong() in our hlep guide. http://ninjatrader.com/support/helpG...7/exitlong.htm
If we can be of any other assistance please let us know.Cody B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Jon17, Today, 04:33 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
4 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
||
Started by timmbbo, Today, 08:59 AM
|
2 responses
10 views
0 likes
|
Last Post
by bltdavid
Today, 04:10 PM
|
||
Started by alifarahani, Today, 09:40 AM
|
6 responses
41 views
0 likes
|
Last Post
by alifarahani
Today, 03:18 PM
|
||
Started by Waxavi, Today, 02:10 AM
|
1 response
19 views
0 likes
|
Last Post Today, 03:03 PM |
Comment