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

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 helpwanted, Today, 03:06 AM
            1 response
            5 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            7 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            5 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            242 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            384 views
            1 like
            Last Post Gavini
            by Gavini
             
            Working...
            X