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
Trailing stop attachment
Collapse
X
-
Hi Teebone21, thanks for your question.
I have an example here on a break even in the strategy builder. You can take this same concept and update the stop loss to a value that changes over time instead of the average entry price.
Please let me know if I can assist any further.
Attached FilesChris L.NinjaTrader Customer Service
- Likes 2
-
Hello Chris,
please could you explain:
when StopLossMode == 0 is likely expected a stop loss set on the next tab of the SB?
I remember a similar sample using state/ bool, is there a specific reason this sample now uses a StopLossMode/ integer ? What is the advantage?
How would it be possible to add another exit condition working together with the breakeven when StopLossMode==1, for example exit when current price crosses low[1] ?
thank you.
Comment
-
Hello guidoisot,
Thanks for your post.
When there are two condition states you can use a bool or you can use a numerical value, either way makes no difference as it is up to you as the programmer to know if you are using a bool or a numerical value.
Yes, you can add another exit condition when the variable StopLossMode is equal to 1. You would basically copy set 4 and add the cross condition and change the exit to an ExitLong.
Paul H.NinjaTrader Customer Service
- Likes 1
Comment
-
thank you.
I have added a third exit but it does not work.
At time 16:00 there is also a trade that does not breakeven.
Please can you help to find out why?
BREAKEVENstrategyMANUAL02.cs
Last edited by guidoisot; 04-29-2020, 06:54 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by tony_28217, Today, 07:04 PM
|
0 responses
3 views
0 likes
|
Last Post
by tony_28217
Today, 07:04 PM
|
||
Started by flybuzz, Today, 10:33 AM
|
1 response
9 views
0 likes
|
Last Post
by flybuzz
Today, 06:59 PM
|
||
Started by spencerp92, 10-10-2023, 09:56 AM
|
4 responses
304 views
0 likes
|
Last Post
by flybuzz
Today, 06:45 PM
|
||
Started by samish18, Yesterday, 10:13 AM
|
1 response
25 views
0 likes
|
Last Post Today, 06:15 PM | ||
Started by Austiner87, Today, 05:02 PM
|
0 responses
7 views
0 likes
|
Last Post
by Austiner87
Today, 05:02 PM
|
Comment