Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
trailing trigger in certain point
Collapse
X
-
trailing trigger in certain point
i just wonder if i can use the trailing in strategy builder such as trigger the trailing for example: when i win 40 ticks, then trailing will start with the distance -20 tickTags: None
-
Hello trongle1212,
Welcome to the NinjaTrader forums!
Yes, this is possible using Exit orders by calculating a trigger distance for when the trail action should next update, and a trail distance to supply to the exit order method.
Below is a link to an example that opens in the Strategy Builder.
I also recommend watching the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video.
Chelsea B.NinjaTrader Customer Service
- Likes 1
-
Originally posted by NinjaTrader_ChelseaB View PostHello trongle1212,
Welcome to the NinjaTrader forums!
Yes, this is possible using Exit orders by calculating a trigger distance for when the trail action should next update, and a trail distance to supply to the exit order method.
Below is a link to an example that opens in the Strategy Builder.
I also recommend watching the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video.
https://ninjatrader.com/support/foru...pts#post786040
Comment
-
Hello trongle1212,
Yes, the example is limited as it is trying to express an idea. Save the price plus a number of ticks to a variable as the trigger, save the price minus a number of ticks to a variable as the working stop price. When the market price is above the trigger price, update the trigger price to the market price plus number of ticks to the trigger variable, update the stop price to the market price minus a number of ticks.
This same concept can be applied to short positions as well using the opposite values. Save the price minus a number of ticks to a separate variable as the trigger, save the price plus a number of ticks to a variable as the working stop price.
To make things easy for the user, instead of adding more inputs for the short position trail frequency and trail distance, the developer can use a custom series in the strategy builder to do custom math and multiply the trail stop distance ticks by -1 for long positions and the trail frequency ticks number by -1 for short positions.
As this does get requested frequently, i've added TrailLongShortBuilderExample_NT8 to the examples on this forum post.
https://ninjatrader.com/support/foru...596#post806596Chelsea B.NinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello trongle1212,
Yes, the example is limited as it is trying to express an idea. Save the price plus a number of ticks to a variable as the trigger, save the price minus a number of ticks to a variable as the working stop price. When the market price is above the trigger price, update the trigger price to the market price plus number of ticks to the trigger variable, update the stop price to the market price minus a number of ticks.
This same concept can be applied to short positions as well using the opposite values. Save the price minus a number of ticks to a separate variable as the trigger, save the price plus a number of ticks to a variable as the working stop price.
To make things easy for the user, instead of adding more inputs for the short position trail frequency and trail distance, the developer can use a custom series in the strategy builder to do custom math and multiply the trail stop distance ticks by -1 for long positions and the trail frequency ticks number by -1 for short positions.
As this does get requested frequently, i've added TrailLongShortBuilderExample_NT8 to the examples on this forum post.
https://ninjatrader.com/support/foru...596#post806596
thank you for your reply
i did create 1 with trailing, it work with replay, but not in realtime
Comment
-
Hello trongle1212,
I've had to make modifications to submit an exit market order when the calculated price is above the bid / below the ask to avoid stop order rejections due to an invalid price.
I've tested this example in real-time and it appears to be working without issue.
Please re-download and import and test once more.
If you follow the exact steps in this video using the script I have provided you, the behavior is different than what is shown in the video?Chelsea B.NinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello trongle1212,
I've had to make modifications to submit an exit market order when the calculated price is above the bid / below the ask to avoid stop order rejections due to an invalid price.
I've tested this example in real-time and it appears to be working without issue.
Please re-download and import and test once more.
If you follow the exact steps in this video using the script I have provided you, the behavior is different than what is shown in the video?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by realblubb, Today, 09:28 AM
|
0 responses
1 view
0 likes
|
Last Post
by realblubb
Today, 09:28 AM
|
||
Started by AaronKoRn, Yesterday, 09:49 PM
|
1 response
18 views
0 likes
|
Last Post
by Rikazkhan007
Today, 09:24 AM
|
||
Started by ageeholdings, Today, 07:43 AM
|
0 responses
12 views
0 likes
|
Last Post
by ageeholdings
Today, 07:43 AM
|
||
Started by pibrew, Today, 06:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
14 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
Comment