Is there an automated way using an indicator or strategy to exit Ninja trader once I have reached some daily profit value let's say 5 points ? My issue is I am over trading and giving up all after profitable. This is just to set some discipline. Thank you.
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 Nijnja after daily 5 points
Collapse
X
-
close Nijnja after daily 5 points
Hello:
Is there an automated way using an indicator or strategy to exit Ninja trader once I have reached some daily profit value let's say 5 points ? My issue is I am over trading and giving up all after profitable. This is just to set some discipline. Thank you.Tags: None
-
Hello mtamaku,
Thanks for writing in.
This would be possible in the context of C# but we do not offer a supported means to shut down the platform through NinjaScript. One option would be to apply logic to your strategies so they stop taking trades after a certain point, however.
The Performance object could be used to get a strategies trade performance, or you can use GetAccountValue() to monitor the RealizedProfitLoss of the account. GetAccountValue(AccountItem.RealizedProfitLoss) will not be shown in points since it is a collective figure involving multiple instruments.
NinjaTrader 8 has a CloseStrategy() method which can cancel orders and close positions made by the strategy, but NinjaTrader 7 would need to have that functionality implemented by the strategy developer.
I've included documentation links to the items discussed as well as a sample for creating a time filter.
Performance - https://ninjatrader.com/support/help...erformance.htm
TradesPerformance - https://ninjatrader.com/support/help...erformance.htm
GetAccountValue() - https://ninjatrader.com/support/help...countvalue.htm
SampleTimeFilter - https://ninjatrader.com/support/foru...ead.php?t=3226
Please let me know if you have any additional questions.JimNinjaTrader Customer Service
-
Hello elliot5,
You will need to check your syntax. In your snippet, you are calling GetAccountValue with AccountItem.RealizedProfitLoss + " " + "Realized PnL" instead of AccountItem.RealizedProfitLoss.
See here for a test with proper syntax - https://i.imgur.com/Scm8Yd5.png
We look forward to assisting.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by sidlercom80, 10-28-2023, 08:49 AM
|
168 responses
2,261 views
0 likes
|
Last Post
by sidlercom80
Today, 12:05 AM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
3 responses
10 views
0 likes
|
Last Post Yesterday, 11:58 PM | ||
Started by WeyldFalcon, 12-10-2020, 06:48 PM
|
14 responses
1,428 views
0 likes
|
Last Post
by Handclap0241
Yesterday, 10:43 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
2 responses
9 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:31 PM
|
||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
41 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
Comment