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!
See more
See less

Partner 728x90

Collapse

Sell when price drops below a certain level.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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!

    #2
    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.
    Attached Files
    MatthewNinjaTrader Product Management

    Comment


      #3
      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


        #4
        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


          #5
          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


            #6
            Hello,

            Instead of using the DefaultSeries, please try using Price Data--> Low as the series of the Lowest bar
            MatthewNinjaTrader Product Management

            Comment


              #7
              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


                #8
                Hello,

                Sorry for the confusion - we need to be using MIN to get the lowest price.

                You will find this under Indicators--> Min

                The parameters you would use would be Period of 10 and Barsago of 1.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  OK, so I've tried using the MIN indicator as outlined, but it when I input the instructions like you've outlined, a sell signal is generated when the low goes below the lowest close of the last 10 days, not the low.

                  Comment


                    #10
                    Did you run this on the "DefaultInput" or did you change that to "Low"?
                    Attached Files
                    MatthewNinjaTrader Product Management

                    Comment


                      #11
                      This worked, thank you very much!

                      Comment


                        #12
                        hi - can you tell me how i would do a similar instruction via the GUI. I want to "exit" (a long) if price trades below - the low on the bar prior to entery if that can not be done than 25pip less than low of the bar upon which i entered the trade

                        Comment


                          #13
                          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.
                          Attached Files
                          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 funk10101  
                          Started by pkefal, 04-11-2024, 07:39 AM
                          11 responses
                          36 views
                          0 likes
                          Last Post jeronymite  
                          Started by bill2023, Yesterday, 08:51 AM
                          8 responses
                          44 views
                          0 likes
                          Last Post bill2023  
                          Started by yertle, Today, 08:38 AM
                          6 responses
                          25 views
                          0 likes
                          Last Post ryjoga
                          by ryjoga
                           
                          Started by algospoke, Yesterday, 06:40 PM
                          2 responses
                          24 views
                          0 likes
                          Last Post algospoke  
                          Working...
                          X