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

BarsArray question

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

    BarsArray question

    In my stategy I want to use:

    If the of the ADX Slope is greater than 0 average for the last 3 bars on BarsArray[1] then...

    I have the following:

    Slope(ADX(BarsArray[1], 14, 3), 0) > 0

    I must be missing something because I cant seem to get it to compile. I have included a screen shot. Any help would be greatly appeciated

    Thank you,
    Attached Files

    #2
    Hi Jeff 15, please see if this works -
    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] myAdxSlope = Slope(ADX(BarsArray[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]], [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]14[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]), [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]3[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]);[/SIZE][/SIZE]
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Still need help

      Thanks Bertrand,

      Im still having trouble. I must have in put the code incorrectly. I have attached a screen shot to show you what I have.
      Thank you,
      Attached Files

      Comment


        #4
        Jeff, this was just a sample for the correct Slope call - you want to replace it with yours in your code and see if that compiles well.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Ok I got it

          Thanks Bertrand,

          I got it now.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by samish18, 04-17-2024, 08:57 AM
          16 responses
          55 views
          0 likes
          Last Post samish18  
          Started by arvidvanstaey, Today, 02:19 PM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Started by jordanq2, Today, 03:10 PM
          2 responses
          8 views
          0 likes
          Last Post jordanq2  
          Started by traderqz, Today, 12:06 AM
          10 responses
          18 views
          0 likes
          Last Post traderqz  
          Started by algospoke, 04-17-2024, 06:40 PM
          5 responses
          47 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X