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 DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      11 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      8 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      7 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Working...
      X