thanks in advance
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 based on bar close below indicator
Collapse
X
-
Hello and thank you for your prompt reply. I am new to ninja trader and I am not currently working with any strategy. I would like to be able to use a strategy to trail a portion of a position such that when a bar, either intro day or daily, depending on the situation closes below a given moving average. I saw the parameter to offset based on moving average but not to only trigger a close up on the close of the bar below the moving average. How would one accomplish this? Kind regards, Tom
Comment
-
Hello tffmd123,
Thanks for your reply.
Can you provide a reference to, " I saw the parameter to offset based on moving average but not to only trigger a close up on the close of the bar below the moving average"?
I'm just trying to understand the context of what you are working with if it is not a strategy.
Thanks in advance.
Paul H.NinjaTrader Customer Service
Comment
-
Hello tffmd123,
Thanks for your reply.
In that situation of manually attaching an order to an indicator, there are no options to fill the order when the bar closes. You can add an "offset" in ticks so that for the order to fill the price would have to cross the moving average by however many ticks you specify. (Use a negative number to subtract ticks).
Otherwise, you could create a Ninjascript strategy that monitors price and the moving average, and when the cross of the close price over the moving average has been detected, the strategy can issue a market order to exit the position. However as this strategy did not initiate the original entry, you would have to use the AdoptAccountPosition and this precludes creating the strategy in the Strategy Builder.
Paul H.NinjaTrader Customer Service
Comment
-
You could do this with your own custom indicator. For example the custom indicator would calculate its value based on your moving average from the previously closed bar. Then you can attach your stop to your custom indicator, knowing that the value of your custom indicator will always be the value of the moving average indicator from the previously closed bar.
I've done something similar, where the stop loss automatically trials to 1 tick below the last closed bar.
Originally posted by tffmd123 View PostI was referring to the option to attach a stop to an indicator within chart trader
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by trilliantrader, 04-10-2024, 09:33 PM
|
7 responses
25 views
0 likes
|
Last Post Today, 11:56 AM | ||
Started by traderqz, Today, 12:06 AM
|
5 responses
11 views
0 likes
|
Last Post Today, 11:34 AM | ||
Started by Mongo, Today, 11:05 AM
|
2 responses
10 views
0 likes
|
Last Post
by Mongo
Today, 11:29 AM
|
||
Started by guillembm, Today, 11:25 AM
|
0 responses
5 views
0 likes
|
Last Post
by guillembm
Today, 11:25 AM
|
||
Started by Tim-c, Today, 10:58 AM
|
1 response
3 views
0 likes
|
Last Post Today, 11:20 AM |
Comment