Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

automated TrendChannel Indicator. Cant find the paramteters for the second low,

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

    #16
    Hey Chelsea,

    thanks for the reply

    The bar numbers are the "idx"
    The price values are the "value"

    I need the first and the third price value and bar numbers from the loop.
    Take a look at the picture there you can see what i mean.

    best regards
    TradeMyth

    Comment


      #17
      Picture with the line
      Attached Files

      Comment


        #18
        Hello TradeMyth,

        The last low from the ZigZag will be:
        Low[Math.Max(0, ZigZag(DeviationType.Points, 0.5, false).LowBar(0, 1, 100))]);

        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Hey Chelsea,

          Thanks for the fast reply

          I appreciate your help but it's not what I need

          I need the values from this for loop. How can I isolate and acces the single values.
          I need the first value and the third value.

          In the picture you can see that i marked them with 1 and 3. In this case the values are 1.2335 (the first one) and 1.123 (the second one). These are the values I need.

          my question is how do I isolate the values from the for loop and then use them for my line?

          I'm new to prgramming and don't know how to do that.



          Code:
                      for (int idx = ChartBars.FromIndex; idx <= ChartBars.ToIndex; idx++)
                      {
                          if (idx < startIndex || idx > Bars.Count - (Calculate == NinjaTrader.NinjaScript.Calculate.OnBarClose ? 2 : 1) || idx < Math.Max(BarsRequiredToPlot - Displacement, Displacement))
                              continue;
          
                          bool isHigh = ZZHZZ.IsValidDataPointAt(idx);
                          bool isLow = ZZLZZ.IsValidDataPointAt(idx);
          
                          if (!isHigh && !isLow)
                              continue;
          
                          double value = isHigh ? ZZHZZ.GetValueAt(idx) : ZZLZZ.GetValueAt(idx);
          
          
                          // Save as previous point
                          lastIdx = idx;
                          lastValue = value;
          
          
                          Print("value " + value);
          
          
                      }
          Attached Files
          Last edited by TradeMyth; 04-29-2019, 03:11 PM.

          Comment


            #20
            Hello TradeMyth,

            I see that you have written in to platformsupport [at] ninjatrader [com] with this inquiry.

            I will allow Josh to continue assisting through private email.

            Please note that creating multiple inquiries on the same subject may cause multiple technicians to respond tying up resources with our platform support and delaying our ability to respond to all customers in a timely manner.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            636 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            568 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            571 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X