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
How to close the trade running in a strategy from the chart trader screen
Collapse
X
-
How to close the trade running in a strategy from the chart trader screen
Hello: How do I exit the trade manually that was submitted by the strategy logic without disabling the strategy ? Example, Let's say profit target is 200 and last trade submitted by strategy is making 175$ but I would like to close the trade with that profit vs wait till set profit target of 200. Basically I would like to close the trade early with whatever profit or loss but continue to run the strategy. ThanksTags: None
-
Hello DTSSTS,
Yes, placing manual orders would not cause the strategy position to change. Only the account position would change. However, this would allow you to manually trade while the strategy continuous running.
If you want the strategy position to change, the orders have to be placed by the strategy. (You could have a button that when clicked causes the strategy to place an order.)Chelsea B.NinjaTrader Customer Service
Comment
-
Hi, do you have a sample code or example of how to to stop or exit the trade in progress that was placed by the strategy from the chart trader screen ?
As you suggested at the top, I placed the sell order in opposite direction but that was a separate order from the strategy, I guess for account position. Thanks
Comment
-
Put your self a trail stop if you can, place it well below whatever you are currently using, just slide the Order showing on the chart up to your current price depending on the candlestick type it may stay where you moved it long enough to trigger, thus closing your trade from within the strategy
Comment
-
something i discovered today, I have a Trailing Stop that i use as a back up stop, but you can actually attach that stop to an indicator after the position is entered and it will then follow the indicator, ie may a 1 period sma of the Lows or I used a bollinger band and set to a 1.5 std dev and 20 periods , when i am in a big uptrend, i can take the trailing stop that is well below my current candles and attach it to the Upper band of the Bollinger and it will trail perfect with that and not resume the ticks of the trial of the strategy
Also the Profit target can be used that way as well, generally if you move the profit target down closer to your current candles it will move itself back to the correct price indicator by the strategy on the very next tick. I for example attached my profit target to Prior Day High of day and exited into that area
Comment
-
Hi Chelsea, I was revisiting this old post and have no problem enabling and seeing those buttons in the chart. What I did NOT manage is to close position of the currently running and enabled strategy by pressing on one of those buttons. Did I understand correctly that by loading one-by-one bar-button strategy along with my own strategy will enable me to close position in my own strategy or I need to put bar-button strategy inside my own strategy for bar-button strategy have a desired effect. Suggested trail stop could work but bar button indeed looked pretty cool. Cheers
Comment
-
Hello kazbek966,
A NinjaScript Strategy is only able to see orders submitted by that instance of the strategy. Other running strategy instances are not able to affect any other strategies position or orders.
Further, a NinjaScript strategy is not able to manually submitted orders.
This could mean that to have orders affect the strategy position, that strategy instance needs to have the orders submitted (from a button click if you would like).
I have a few better examples available now.
I need some guidance. I need to create a script that has 3 plots that are public and they plot either a 1 or 0. But I need to create another indicator that has 3 chart buttons that sets these variables. The first indicator needs to get those values from the second indicator depending on the button clicks. Because of usingChelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
435 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
3 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
18 views
0 likes
|
Last Post Today, 03:33 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
9 responses
126 views
1 like
|
Last Post
by caryc123
Today, 03:12 PM
|
||
Started by selu72, Today, 02:01 PM
|
1 response
12 views
0 likes
|
Last Post Today, 02:17 PM |
Comment