• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

lowest low

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

    lowest low

    hi

    im trying to write strategy that uses lowest low and highest high .
    but whenever i use (price close <= lowest bar ( low) x period ago ) it wont enter to a position.

    what seems to be the problem ?

    #2
    Hi german87,

    Are you trying to do this with an Atm Strategy in the SuperDOM or Chart Trader?

    (I ask because this post is in the Atm Strategies section)

    Or are you doing this in a NinjaScript strategy?

    If this is in a NinjaScript strategy may I see the code you are using?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      im doing this in ninja strategy wizard

      Comment


        #4
        Hi german87,

        May I see the code you are using? (Click View Code)
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          i have attached the strategy , is it enough ?
          Attached Files

          Comment


            #6
            Hello german87,

            Currently you are using LowestBar in your script.

            LowestBar returns a BarsAgo value not a price.

            I think you are wanting Low[LowestBar(Low, 7)].

            This cannot be done with the Strategy Wizard and you would need to unlock your script and add this code manually.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              can you please write this to me in the strategy i sent you ?
              so i would have an example

              thanks !!!

              Comment


                #8
                Hi german87,

                Yes, I have made an example for you and attached to this post.
                Attached Files
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hi german87,

                  Yes, I have made an example for you and attached to this post.
                  I was very interested to look at the code, Chelsea. I noticed you used the method Low[LowestBar(Low, ... as suggested by german87.

                  The following is a point I've tried to make in the Forum a few times:

                  Isn't, to use the exact code used in the strategy, Low[LowestBar(Low, 7)] the exact mathematical equivalent of MIN(Low,7)?

                  Correct me if I'm wrong, Chelsea, but I think the only point in using LowestBar is if you're trying to locate how many bars ago the lowest bar occurred, which isn't the case here.

                  If I'm right, then I'm guessing that MIN(Low, ... is more efficient in terms of processing than Low[LowestBar(Low, ... if only marginally. Would this be a correct assumption?

                  Thanks for letting me know.

                  P.S. Also in code, you have:

                  (Close[0] >= HighestBar(High, 7))

                  which is a double compared to an int. Maybe this should be:

                  (Close[0] >= High[HighestBar(High, 7))] or even MAX(High,7) ???

                  Comment


                    #10
                    Hi arbuthnot,

                    You are correct!

                    MIN(Low, 7) is the same as Low[LowestBar(Low, 7)]

                    I wouldn't be able to say which uses less resources. It is probably the same.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Nat11, Today, 04:30 AM
                    1 response
                    12 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by Option Whisperer, Yesterday, 11:50 AM
                    2 responses
                    10 views
                    0 likes
                    Last Post Option Whisperer  
                    Started by TraderJim618, Yesterday, 01:20 PM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_ChrisL  
                    Started by drpapp, 01-24-2019, 06:57 AM
                    6 responses
                    72 views
                    1 like
                    Last Post brucerobinson  
                    Started by ttodua, 12-06-2019, 11:40 PM
                    1 response
                    12 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X