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 GLFX005, Today, 03:23 AM
      0 responses
      1 view
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      11 views
      0 likes
      Last Post XXtrader  
      Started by Waxavi, Today, 02:10 AM
      0 responses
      6 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      12 views
      0 likes
      Last Post TradeForge  
      Started by Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Working...
      X