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 CortexZenUSA, Today, 12:53 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by CortexZenUSA, Today, 12:46 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by usazencortex, Today, 12:43 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post usazencortex  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,266 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X