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
Taking Partial Profits
Collapse
X
-
Originally posted by NinjaTrader_Josh View PostHi koganam and molecool,
Here are the scenarios available:
Scenario 1
- Single entry order for multiple contracts (Doesn't matter if it was an EnterLong or EnterLongLimit/etc.)
- Multiple ExitLong orders of smaller quantities to scale out of that position generated from a single entry order
- Backtesting <-- works
- Real-time <-- does NOT work. Bugged. Will NOT continue to scale out of the position. Has been tagged for resolution in NT8
Scenario 2
- Single entry order for multiple contracts (Doesn't matter if it was an EnterLong/etc.)
- Multiple ExitLongLimit/Stop orders of smaller quantities to scale out of that position generated from a single entry order (a.k.a. exiting the same fromEntrySignal name)
- Backtesting <-- expected to NOT work
- Real-time <-- expected to NOT work
- NT's managed approach was not designed to allow for closing the same fromEntrySignal twice in this manner. You will get a message like this: "There is already a matching filled order in place". This was not meant to work this way and won't work this way.
Scenario 3
- Multiple entry orders to acquire multiple contracts
- Multiple ExitLongLimit/Stop orders of quantities matching the entry order quantities
- Backtesting <-- works
- Real-time <-- works
- When using entry orders A, B, C and corresponding ExitLongLimit/Stops with matching quantities of A, B, C, you will be able to scale-out properly. Note that each exit order is associated to its own entry order.
Scenario 4
- Unmanaged approach
- Scale in/out works regardless of what you are doing
molecool, from my understanding of what you are trying to achieve, unfortunately the current options available are either scenario 3 or 4.
I'd like to be enter a position and create partial profit target 1, partial profit target 2 and stoploss. My understanding is that this would fall into Josh's Scenario 2 as profit targets are effectively ExitLongLimit orders, and as such, cannot be effected for only part of a position using the Managed Approach.
So if I wanted to effect partial profit targets using the Managed Approach, I have to create multiple entries for a signal (i.e., signalA_entry1, signalA_entry2, signalA_entry3) that sum up to the total position I want on signalA. Then I could have a profit target and stop loss for each of these named entries.
Is this correct?
Comment
-
Walk Forward Multiple Targets
Hello,
i thought that i dont have to create a new topic for my question, so i ask here.
I use multiple Targets too and want , that the different targets have a minimum distance from each other. In Optimization the Pc often search the one optimal targetpoint, which is good in optimization but not in walk forward.
in MQL4 it works if i change the OrderOpenCondition like that (Target1 < (Target2-5))
but in Ninja the tester sometimes make nothing because he says no result is the best result and takes for example Target1 =10 and Target2 =10.
How i can divorce each other with a minimum distance?
best regards
Comment
-
FX90903, this would be possible via the properties, consider this example snippet taken from our SampleMACrossOver. You cannot set a lower value for Slow than Fast + 1. So with the default values if you try a value lower than 10 for Slow > it will change the value to 11.
Code:[Description("Period for fast MA")] [GridCategory("Parameters")] public int Fast { get { return fast; } set { fast = Math.Max(1, value); } } [Description("Period for slow MA")] [GridCategory("Parameters")] public int Slow { get { return slow; } set { slow = Math.Max(fast + 1, value); } }
BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, Today, 08:54 AM
|
3 responses
16 views
0 likes
|
Last Post
by ETFVoyageur
Today, 09:23 AM
|
||
Started by ETFVoyageur, Today, 02:15 AM
|
3 responses
20 views
0 likes
|
Last Post Today, 09:00 AM | ||
Started by Andrei60, Today, 08:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by Andrei60
Today, 08:56 AM
|
||
Started by ETFVoyageur, Today, 06:11 AM
|
3 responses
17 views
0 likes
|
Last Post Today, 08:54 AM | ||
Started by Belfortbucks, Today, 08:21 AM
|
1 response
8 views
0 likes
|
Last Post Today, 08:37 AM |
Comment