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

ROC of T3

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

    ROC of T3

    Hi, I'm new to using NT script. I'm trying to find the ROC of the T3 moving average. I've followed the tutorial for an indicator using another indicator for input. I'm getting the CS0021 error. Below is the code snippet I wrote. Any suggestions? The bars ago perhaps? Thanks.

    protected override void OnBarUpdate()
    {
    // Find ROC of T3
    double value = ROC(T3(6, 3, 0.7), 1)[0];
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    Plot0.Set(value[0]);
    }

    #2
    Hello,

    Thank you for your post and welcome to our forums!

    double values do not have an index assigned to it. The indexing takes place within the double value based on the ROC data series

    For your Plot0.Set, you just need to use the double "value":

    Plot0.Set(value);

    This value will update when the ROC updates.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Cheers Matthew!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by benmarkal, Yesterday, 12:52 PM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by helpwanted, Today, 03:06 AM
      1 response
      18 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      11 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      6 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      244 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Working...
      X