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

MIN indicator error / wrong output in the strategy?!

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

    MIN indicator error / wrong output in the strategy?!

    Hello ,

    - (I have uploaded the important information / pictures) -

    Although I have specified in the settings that the strategy should only go short when the "MIN" is undershot ....
    But how can the strategy go short over the price if the IF condition above does not actually allow it?
    The period for the MIN indicator is set to 3

    How can the lowest short price of the indicator 58.37 be if it uses the last 3 candles for calculation?

    Thanks!


    #2
    Hi Yannick, thanks for your post.

    I do not fully understand the problem. Is the strategy entering short when it is not supposed to? Have your printed your conditions whenever EnterShort is called? For example, when your set 3 becomes true, print out everything used in the above condition to see why it became true.

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      " Is the strategy entering short when it is not supposed to? "
      Yes, the strategy goes short although the condition does not allow it .
      Or have I overlooked a mistake?

      The condition is: GetCurrentBid(...) < MIN(Period)[0]
      (Period = 3)

      Thanks!

      Comment


        #4
        Hi Yannick, thanks for your reply.

        Please use the Print statement to print out the values of GetCurrentBid(...) and MIN(Period)[0] along with the EnterShort method, what values are these methods returning? It might also help to create a new strategy with 0nly this condition and single out the problem that way.

        I look forward to hearing of your results.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          .

          I did it now and uploaded the picture

          How can the Min Price be 58.37 if it uses the last 3 candles for the calculation?

          Comment


            #6
            Hi Yannic, thanks for your patience.

            Something like this code will return the minimum Close price of the bar that just closed, and the two bars behind it:



            Did you need to get the lowest low or lowest close in your strategy? If you need some other input series to get the minimum, specify the series like so Min(Low, 3)[0].

            I think this is just a matter of getting the correct minimum here. Also, note that the GetCurrentBid method is getting the very most current bid price, and this can be different than any values you see on the last closed bar.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WHICKED, Today, 12:45 PM
            2 responses
            16 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,272 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            2 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X