Please advise. 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
Scaling Out of a Position
Collapse
X
-
Scaling Out of a Position
I want to set up multiple targets to scale out of a potion: 6, 9, 12, 18 Ticks from entry. I cannot get it to work properly in the NT8 Strategy Builder. The parameters show up, but they do not scale out.
Please advise. Thanks!1 PhotoTags: None
-
Hello rjsjr64,
Thanks for your post.
To accomplish your goal in the Strategy Builder, you will have to create separate entries for each exit and use signal names to tie them together (This entry with that profit target and that stop).
For example:
(your conditions to enter)
EnterLong("First");
EnterLong("second");
EnterLong("Third");
etc etc.
If you want to you can use 1 stoploss that would apply to all: SetStopLoss(CalculationMode.Ticks, 10); // applies to all entries
Or you can set individual stops if you prefer by using the signal name, for example
SetStopLoss("First", CalculationMode.Ticks, 10); // applies only to the entry named "First"
SetStopLoss("second", CalculationMode.Ticks, 12); // applies only to the entry named "second"
etc, etc.
Finally, for the individual profit targets, you would need to specify them like:
SetProfitTarget("First", CalculationMode.Ticks, 6);
SetProfitTarget("second", CalculationMode.Ticks, 9);
SetProfitTarget("Third", CalculationMode.Ticks, 12);
etc, etc.
NOTE: The signal names for the stops and profit targets must match exactly the name used in the entry.
Reply to post #2
You cannot use an ATM with the strategy builder.
What you want to work with is a Ninjascript strategy that uses an ATM template to accomplish your goals where the strategy will find the entry conditions and place the entry order, once filled the specified ATM will take over providing the template specified profit and stop(s). You can then manipulate these manually during the trade as you wish. Once the trade has been closed, the strategy will look for the next entry.
In your NinjaTrader is an example of this type of strategy called SampleAtmStrategy. Please review this strategy in the Ninjascript editor as the code is the best example we have of this type of hybrid strategy. The code of the strategy is well commented to help understand the requirements of use as well as how the various property and methods work. The comments advise to create an ATM template (for the demonstration) called "AtmStrategyTemplate" and it can be created as you wish to configure it.
The sampleATMstrategy uses special methods and properties that do not access the normal strategy methods and properties, here is a link to the help guide section on these special ATM methods and properties: https://ninjatrader.com/support/help...gy_methods.htm
Please note:- The Strategy Builder does not support ATMs
- Strategies that use ATM methods cannot be "backtested" in the strategy analyzer.
- Strategies that use ATM methods can be tested with Playback using Market replay data.
- Strategies that use ATM methods need to skip historical data processing (as shown in the example strategy).
Paul H.NinjaTrader Customer Service
Comment
-
Hello rjsjr64,
Thanks for your reply.
...but when triggered only the entry 1 takes place
You can edit the property in the Strategy Builder on the "Default Properties" window under "More Properties".
You can also set (and check) the property when you apply the strategy. https://ninjatrader.com/support/help...tegyProperties
The Sample ATM strategy is not available in the Strategy Builder. To access it you have to go to New>Ninjascript Editor>Strategies>Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wuannetraam, Today, 02:40 AM
|
0 responses
6 views
0 likes
|
Last Post
by wuannetraam
Today, 02:40 AM
|
||
Started by cyberpete76, 03-27-2023, 12:29 AM
|
7 responses
268 views
1 like
|
Last Post
by slightly
Today, 01:47 AM
|
||
Started by renewsaltwater, Today, 01:15 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 01:15 AM | ||
Started by slightly, Today, 12:49 AM
|
0 responses
4 views
0 likes
|
Last Post
by slightly
Today, 12:49 AM
|
||
Started by sdauteuil, 09-23-2021, 10:16 AM
|
4 responses
1,211 views
0 likes
|
Last Post Yesterday, 11:41 PM |
Comment