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
please create a breakeven for Strategy builder
Collapse
X
-
Hello DTSSTS,
Thanks for your post.
The Strategy Builder can create Breakeven functionality by logically controlling your exit in Conditions and Actions. I have attached a demonstration that can explain the basics behind creating such a strategy. Keep in mind, logic will have to be added to reset your bool that controls the Move To Breakeven so the strategy's next entry will submit the exit to the initial level.
Demo - https://www.screencast.com/t/DsJf82f464f
We have previously tracked your interest to have Breakevens offered out of box in the Strategy Builder in the thread here. The feature request ticket ID is SFT-2212.
We collect interest in feature requests before determining if the feature should be implemented. For that reason we cannot offer an ETA or promise of fulfillment. Upon implementation, the number for the ticket ID can be publicly found in the Release Notes page of the help guide. I will provide a link below.
Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
Please let us know if you have any questions.JimNinjaTrader Customer Service
-
Hello DTSSTS,
We should be clear that in the Support Department, it is not our role design logic, but to show you how to use the tools we have available like the Strategy Builder and documented NinjaScript code. My video in post #2 is to convey an idea, and should not be taken as an example that should be used as-is.
When creating logic, it will be necessary to take debugging steps to understand exactly what the logic you have written is doing so it can be corrected. It looks like you and NinjaTrader_Chelsea were discussing how to debug the logic. I have a video that describes how debugging prints can be added in the Strategy Builder which may help you to check and verify the logic you have created in the Builder.
Debugging in the Strategy Builder - https://www.screencast.com/t/8uvjfM8h
Please let me know if I can be of further assistance.JimNinjaTrader Customer Service
Comment
-
as far as i can tell this is what i have been working on for 9 days. the issue is by the time you get back to the point For your breakeven order to be submitted your condition will no longer be True
Default input[0] > Position.AveragePrice + (5 * TickSize))
will not be True when the price reaches the BreakEven point
Comment
-
Hello DTSSTS,
The idea is to set a bool when your Breakeven condition is true.
When the bool is false and you are in position, your initial stop should be submitting.
When the bool is true and you are in position, your an exit order should be submitting to the average entry price.
Please let me know if you have any additional questions.JimNinjaTrader Customer Service
Comment
-
Hello DTSSTS,
Do you see any errors in the log tab of the Control Center?
Is the strategy in a virtual position calculated from historical data after you enable the strategy? Please see the bottom of this post for more details.
When you enable TraceOrders (set in Default Properties page of the Strategy Builder) do you see any feedback that tells you what is happening?
When you add debugging prints, can you verify that your conditions are becoming true, and your order submission methods are in fact getting reached?
When a strategy is enabled, it processes historical data to determine trades that the strategy would have made on the data that is already on the PC/chart and to determine what position the strategy is in. (Strategy positions are separate from actual Account positions.) If the strategy calculates that is in a virtual position when it transitions to processing realtime data, the strategy's Start Behavior may waiting until this position becomes flat before orders are allowed to submit with realtime data. (Wait Until Flat.) You can observe the Strategies tab of the Control Center if the strategy is in a virtual position waiting to become flat. The strategy will be orange/yellow when waiting to for the historical position to be closed, and will be green when allowed to trade live.
Strategy Position vs. Account Position - https://ninjatrader.com/support/help..._account_p.htm
Start Behaviors - https://ninjatrader.com/support/help..._positions.htm
Trace Orders - https://ninjatrader.com/support/help...aceorders2.htm
I look forward to being of further assistance.JimNinjaTrader Customer Service
Comment
-
Great Video to set Break Even or Other advancing stops
- Likes 1
Comment
-
My only post on this forum, and I just wanted to say thank you for making the video but for some reason I just cannot get the stop orders to get placed. I followed your directions exactly. I understand the logic behind it, but my neither of stop orders get placed after my entry gets filled. I am going on 12 hours (3 night) now, I have the rest of my strategy done but I cant let this strategy run wild with a moving trailing stop IT NEEDS TO BE A STOP BACK TO BREAK EVEN.
Comment
-
Welcome to the forums noshowstock!
I have attached some examples that can demonstrate breakeven behaviors in the Strategy Builder using Exit methods in the Conditions and Actions field. I still recommend the instruction included here as it explains the logic involved and how you can take debugging steps to check how your logic is processed. Our goal is to provide resources and instruction to accomplish your goals as we cannot design logic for all client inquires.
We look forward to assisting.Last edited by NinjaTrader_Jim; 06-05-2020, 01:40 PM.JimNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jim View PostWelcome to the forums noshowstock!
I have attached some examples that can demonstrate breakeven behaviors in the Strategy Builder using Exit methods in the Conditions and Actions field. I still recommend the instruction included here as it explains the logic involved and how you can take debugging steps to check how your logic is processed. Our goal is to provide resources and instruction to accomplish your goals as we cannot design logic for all client inquires.
We look forward to assisting.
p.s. Try to run those strategies yourself and you will see that they will not throw out stop loss orders, let alone move them to break even. The logic makes sense but there is just something missing that is not letting the stops be placed through the "Do the following" window.
p.s.s. I am in the process of adding some prints to see what is "stuck"
Comment
-
Hello noshowstock,
The MoveToBEStrategyBuilder zip I uploaded appears to be a version that is calling Enter methods for the stop loss, when ExitLongStopMarket should be used. I checked the version I have on this PC and I uploaded the correct version to post #12. Attached here is a screenshot showing the Breakeven exit taking place.
I look forward to assisting.JimNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jim View PostHello noshowstock,
The MoveToBEStrategyBuilder zip I uploaded appears to be a version that is calling Enter methods for the stop loss, when ExitLongStopMarket should be used. I checked the version I have on this PC and I uploaded the correct version to post #12. Attached here is a screenshot showing the Breakeven exit taking place.
I look forward to assisting.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by WHICKED, Today, 12:45 PM
|
1 response
10 views
0 likes
|
Last Post Today, 01:08 PM | ||
Started by samish18, Today, 01:01 PM
|
0 responses
5 views
0 likes
|
Last Post
by samish18
Today, 01:01 PM
|
||
Started by WHICKED, Today, 12:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by WHICKED
Today, 12:56 PM
|
||
Started by Spiderbird, Today, 12:15 PM
|
2 responses
11 views
0 likes
|
Last Post
by Spiderbird
Today, 12:48 PM
|
||
Started by FrazMann, Today, 11:21 AM
|
2 responses
8 views
0 likes
|
Last Post Today, 12:38 PM |
Comment