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
Sell when price drops below a certain level.
Collapse
X
-
Sell when price drops below a certain level.
Hello everyone. I am new to Ninja Trader and have no programming background hence I am using the strategy wizard to build my strategy. I have been building my strategy within the wizard and am starting to get more comfortable with it. However I've run into a problem I can't seem to solve. I need some help to place instructions using the wizard to sell once price drops below the lowest low in the last 10 days. Is this possible to do simply using the strategy wizard? Any help would be appreciated. Thanks!Tags: None
-
Hello,
Thank you for your post and welcome to our forums!
This would be possible, however it would require that you run the strategy on a Daily interval.
You can easily setup this condition by Comparing the Price Data--> Close to the "Misc"--> "Lowest Bar" function, with 10 as the Period.MatthewNinjaTrader Product Management
-
Thanks for your quick reply. Setting up the condition is quite simple as you outlined, however, when I backtest this, it doesn't seem to capture my sell instructions. You mentioned running the strategy on a daily interval, where would I specify this? Just to make sure I'm inputting this correctly, I've put these instructions in the section where it says, "when the following conditions are true" in the wizard. I've then put "exit long" in the section where it says, "do the following" just to keep things simple. Did I input this correct and in the right spot/format?
Comment
-
Hello,
Yes, that should be in the correct place.
When you're back testing the strategy in the Strategy Analyzer, you will have an option for the "Data Series" to test on.
In order for the Lowest Bar period to look back 10 days, you would need to run the strategy on the Daily interval, rather than a tick or minute.MatthewNinjaTrader Product Management
Comment
-
Yes, in the strategy analyser I have the data series set to "day". I also have the minimum bars required set far back enough to allow the strategy enough time. But once again, my sell instructions are not being captured. That is my only exit condition. Any other thoughts/ideas?
Comment
-
Thank you again, however, that still doesn't quite work for me. When I input the close as < the low of 10 bars ago, it only uses exactly 10 days ago as opposed to the lowest low in the last 10 days. Maybe I have this inputted wrong. Thanks for you patience on a simple issue.
Comment
-
Hello hifreq,
You cannot do it via the Strategy Wizard. You can however do it by unlocking the code and further edit it via the NinjaScript editor.
As an alternative you can evaluate your code with the average entry price. The attached screenshot demonstrates how to exit a position if it is 25 below your average entry price.JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by funk10101, Today, 09:43 PM
|
0 responses
2 views
0 likes
|
Last Post
by funk10101
Today, 09:43 PM
|
||
Started by pkefal, 04-11-2024, 07:39 AM
|
11 responses
36 views
0 likes
|
Last Post
by jeronymite
Today, 09:37 PM
|
||
Started by bill2023, Yesterday, 08:51 AM
|
8 responses
44 views
0 likes
|
Last Post
by bill2023
Today, 09:27 PM
|
||
Started by yertle, Today, 08:38 AM
|
6 responses
25 views
0 likes
|
Last Post
by ryjoga
Today, 09:17 PM
|
||
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
24 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
Comment