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
Custom Risk Parameters To Auto Liquidate Position Based On Max Loss Per Trade
Collapse
X
-
Custom Risk Parameters To Auto Liquidate Position Based On Max Loss Per Trade
Is there any custom indicator or strategy that will auto liquidate my accounts based on max loss per trade? I know most brokers have a max daily loss per day, but I want a max loss per trade. That way no matter what my trades will never hit more then certain loss. Reason why I am asking and not using stoploss, is that I am using a trader copier, and today it messed up causing me to loss daily max loss on all accounts, accept the leading accountTags: None
-
Hello josh18955,
Thank you for your post.
It would be possible to monitor PnL and set limits for profit and/or loss that result in a position being closed. We have an example of halting a strategy once user-defined conditions are met here:
To do this from an indicator for orders that were not generated by the strategy would be a little more complex. You could utilize the Account class and subscribe to account-related events such as ExecutionUpdate, OrderUpdate, and PositionUpdate events to keep track of the PnL in the script. You could potentially set up a condition that, once a certain amount of loss is hit, it cancels all orders for that account and instrument and then creates and submits an order to close out the open position. For more information about the Account class, please see the following section of the help guide:- https://ninjatrader.com/support/help...ount_class.htm
- ExecutionUpdate - https://ninjatrader.com/support/help...tionupdate.htm
- OrderUpdate - https://ninjatrader.com/support/help...rderupdate.htm
- PositionUpdate - https://ninjatrader.com/support/help...tionupdate.htm
- CancelAllOrders() - https://ninjatrader.com/support/help...lallorders.htm
- CreateOrder() - https://ninjatrader.com/support/help...reateorder.htm
- Submit() - https://ninjatrader.com/support/help...nt8/submit.htm
Emily C.NinjaTrader Customer Service
- https://ninjatrader.com/support/help...ount_class.htm
-
Your answer is perfect for what I was looking for. I'll implement in the near future and maybe I'll publish too.
Outside of NinjaTrader competencies I am also hoping that some of the forum members who also connect to Rithmic maybe able to interpret the instruction Rithmic has provided on youtube on how to use their account management risk protections. Rithmic published an uncomprehensible explanation on youtube probably on a lazy day. Based on the many videos that have been published on the matter, it is apparent that many people are getting crazy trying to understand them and they give up.
Comment
-
Originally posted by giogio1 View PostYour answer is perfect for what I was looking for. I'll implement in the near future and maybe I'll publish too.
Outside of NinjaTrader competencies I am also hoping that some of the forum members who also connect to Rithmic maybe able to interpret the instruction Rithmic has provided on youtube on how to use their account management risk protections. Rithmic published an uncomprehensible explanation on youtube probably on a lazy day. Based on the many videos that have been published on the matter, it is apparent that many people are getting crazy trying to understand them and they give up.
I tried to search for any existing forum threads that discuss the Rithmic account management risk protections, though I wasn't able to find any that seemed relevant. This thread is certainly open for any forum users to chime in with their interpretation and experience with those parameters if they'd like.
Thank you for using NinjaTrader.Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
14 responses
1,789 views
0 likes
|
Last Post
by aligator
Today, 11:47 AM
|
||
Started by Jimmyk, 01-26-2018, 05:19 AM
|
6 responses
837 views
0 likes
|
Last Post
by emuns
Today, 11:27 AM
|
||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,293 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
||
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
13 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
11 responses
63 views
0 likes
|
Last Post Today, 10:08 AM |
Comment