Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Return spread

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

    Return spread

    Code:
                double a,b,c;
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
                
                b = (Closes[1][0]/CurrentDayOHL(BarsArray[1]).CurrentOpen[0]-1);
                c = (Closes[0][0]/CurrentDayOHL(BarsArray[0]).CurrentOpen[0]-1);
                a = b - c;
                
                {
                Values[0].Set(a);
                Values[1].Reset();
                }
    hi the above code works fine on 1 min data series. but it doesnt work on 2/3/4/5/60 min etc. any idea why? This is an indicator

    Initialize has
    Code:
                Add("NQ 12-14", PeriodType.Minute, 1);

    #2
    Hello calhawk01,

    Thank you for your post.

    What is occurring that is unexpected with higher intervals?

    Are you receiving any errors? If so, what do these errors report?

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello calhawk01,

      Thank you for your post.

      What is occurring that is unexpected with higher intervals?

      Are you receiving any errors? If so, what do these errors report?

      the unexpected with higher intervals is that there is no output. indicator does not calculate anything.

      i don't see any errors. how can i see this in the output screen?

      TraceOrders = true; only works for strategies
      Last edited by staycool3_a; 12-28-2014, 08:11 PM.

      Comment


        #4
        Hello calhawk01,

        TraceOrders would not work for an indicator. Try using Print() to print the values: http://www.ninjatrader.com/support/h.../nt7/print.htm

        Comment


          #5
          Originally posted by calhawk01 View Post
          Code:
                      double a,b,c;
                      // Use this method for calculating your indicator values. Assign a value to each
                      // plot below by replacing 'Close[0]' with your own formula.
                      
                      b = (Closes[1][0]/CurrentDayOHL(BarsArray[1]).CurrentOpen[0]-1);
                      c = (Closes[0][0]/CurrentDayOHL(BarsArray[0]).CurrentOpen[0]-1);
                      a = b - c;
                      
                      {
                      Values[0].Set(a);
                      Values[1].Reset();
                      }
          hi the above code works fine on 1 min data series. but it doesnt work on 2/3/4/5/60 min etc. any idea why? This is an indicator

          Initialize has
          Code:
                      Add("NQ 12-14", PeriodType.Minute, 1);
          Where is, and how is, your CurrentBars check coded?

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X