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
Daily loss limit examples
Collapse
X
-
For some reason, I had to import the script 3 or 4 times before it was visible in the NinjaScript Editor.
Now the question is how do I use this in conjunction with the SampleMACrossOver strategy?
-
Rookie question here. How do I view the DailyLossLimitExample_NT8.zip (1.6 KB, 1 view) once I import it?
- Likes 1
Leave a comment:
-
Thank you. Bad thing - I am not a programmer, so it'll be a challenge. I guess I 'll have to search for an engineer for this.
The reason I wanted that add-on is to "discipline myself" and cancel trading for a day of 200$ loss....
Leave a comment:
-
Hello peter_brv,
To confirm you are making an Addon and not a NinjaScript Strategy, is this correct? All links below are publicly available.
You are wanting to loop through all positions on all accounts?
You would need to loop through the Account.All and for each account loop through the orders and custom calculate the PnL.
You might be able to make a custom TradeCollection and fill it with orders, but this would be outside of what is supported by NinjaTrader Support.
Then after collecting the PnL, you would need custom logic to loop through all positions and close the positions or call Flatten() on the account.
Leave a comment:
-
Hello Chelsea,
Could you please help me. I would like to have an add-on that will stop all my positions if I reach 300$ loss?
How do I need to adjust this strategy so NT8 stops me out if I reach 300$ daily loss?
Let's say, I trade in the morning and at some point I reach 300$, so NT 8 will exit automatically from all my positions...
Thank you!
- Likes 1
Leave a comment:
-
Here's some more NT8 code that does this.
(link removed - no longer valid)
Leave a comment:
-
Daily loss limit examples
Hello,
I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8.
These are often requested and I felt they are good examples to have for NT8.
DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241
DailyLossLimitMultiTradeExample_NT7 - http://ninjatrader.com/support/forum...367#post475367
Update Sep 4th, 2018:
- I realized the print in OnPositionUpdate should print when currentPnL is equal to less than the LossLimit, not just less than it.
Update July 13th, 2020:
- Added DailyLossLimitBuilderExample_NT8; NinjaTrader_PaulH was clever enough to realize the Strategy Builder custom series can be used with offsets to do math and subtract the total pnl from yesterdays pnl to get the current pnl and provided an example.
DailyLossLimitMultiTradeExample_NT8.zip
DailyLossLimitExample_NT8.zip
DailyLossLimitBuilderExample_NT8.zipLast edited by NinjaTrader_ChelseaB; 07-13-2020, 09:39 AM.
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by dcriador, Yesterday, 10:45 AM
|
2 responses
16 views
0 likes
|
Last Post
by dcriador
Today, 04:42 AM
|
||
Started by SnailHorn, Yesterday, 10:49 PM
|
1 response
10 views
0 likes
|
Last Post
by SnailHorn
Today, 03:59 AM
|
||
Started by manueldecastro, Yesterday, 10:26 AM
|
4 responses
21 views
0 likes
|
Last Post Today, 02:56 AM | ||
Started by TraderIqbal, 10-20-2023, 10:12 AM
|
2 responses
120 views
0 likes
|
Last Post
by Funnywo
Today, 02:03 AM
|
||
Started by Creamers, 04-27-2024, 05:32 AM
|
12 responses
72 views
0 likes
|
Last Post
by Creamers
Today, 01:50 AM
|
Leave a comment: