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

Rising & Falling ADX issue

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

    Rising & Falling ADX issue

    Hello,
    I'm trying to identify a previous bar that the ADX was Rising or Falling. My idea was this:
    if (Rising(ADX(10)[1]) == true
    && Falling(ADX(10)[0]) == true),
    but of course I'm getting an error that I can't "convert from 'double' to 'NinjaTrader.Data.IDataSeries'".
    Might there be another way around this issue?

    #2
    Hello,

    Thanks for the forum post.

    Take the [0] and [1] off there and it should compile now.

    When you add the [] this returns a double. If you leave them off this is a data series object.

    Let me know if I can be of further assistance.

    Comment


      #3
      Thanks for the reply. Yes, that will compile, but will it do anything? I want check to see if the previous bar was rising and if the current bar is falling.

      Comment


        #4
        Hello,

        No this would not work for this as this works in realtime only.

        Therefor If I was going to do this I would just program it manually.

        Close[2] < Close[1] &&.//Rising of the last bar
        Close[0] > Close [1 ] //Falling of the current bar

        Comment


          #5
          Good suggestion, but with the ADX indy the Closes can be >or< than the previous without the ADX rising or falling. I need to identify the ADX rising or falling in each bar. I can easily color a bar to show that, but I can't use bar coloring in a strategy.
          Last edited by CaptainAmericaXX; 03-16-2011, 01:15 PM.

          Comment


            #6
            Well of coarse you would want to substitute my example of close with your indicator of choice.

            ADX(10)[2} < ADX(10)[1] etc. etc.

            Comment


              #7
              That did it. Thanks so much!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,602 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              8 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              4 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              12 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X