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

Problem returning value from WCCI

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

    Problem returning value from WCCI

    When checking the value of the WoodiesCCI.ZoneBars[] method/array, I am unable to go back more than 20 bars. Is this by design, or is it a bug? I'm using version 6.5 and here is the code I am using to test the value of the property:

    Code:
    [FONT=Courier New][SIZE=2]double testVal = WoodiesCCI([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]14[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]34[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]25[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]6[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]30[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]100[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]).ZoneBars[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]20[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]];
    [/SIZE][/FONT]
    It seems to return values ranging from 0 - 3 if the array param is 20 or less, but if I use a value over 20, I don't get back anything at all.

    Any ideas?

    Thanks,

    -Scott

    #2
    Check your log tab for any errors in your strategy when running it. For sure it works as expected. I just tested with the code below.

    if (CurrentBar > 20)
    Print(WoodiesCCI(
    2, 5, 14, 34, 25, 6, 60, 100, 2).ZoneBars[20]);

    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply Ray...

      I'm still new to how the framework is being used. This was my error. I did not check to make sure the CurrentBar was greater than the bar I wanted to get information on. I knew there were thousands of bars after the chart was loaded, but I didn't think about the fact that OnBarUpdate() is called when the chart is being loaded the first time for every single bar in history.

      I now have a check in place to make sure I am not trying to look back futher than I have data to see.

      Thanks again...

      -Scott

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PaulMohn, Today, 12:36 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by yertle, Yesterday, 08:38 AM
      8 responses
      36 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Started by rdtdale, Today, 01:02 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by RookieTrader, Today, 09:37 AM
      4 responses
      19 views
      0 likes
      Last Post RookieTrader  
      Working...
      X