Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

new LLs indicator help

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

    new LLs indicator help

    hi,

    I got this volume indicator and would like to add a condition of only coloring the volume bars when the low of current bar is below the lowest low of the day (9:30 to 4:00). Any tips or working samples are appreciated

    thanks

    wx
    Attached Files
    Last edited by wxtrox7; 12-02-2012, 09:26 AM.

    #2
    wx, you could for example look into this sample here - http://www.ninjatrader.com/support/f...ead.php?t=8600

    An alternative approach would be tracking the lowest low seen for your desired time frame in a variable and then comparing to the current bar's close to filter.

    Comment


      #3
      I tried below code using the reference examples but I think I am doing something wrong. Any tips? thanks

      Code:
      protected override void OnBarUpdate()
              {
                  if (CurrentBar<3)
                      return;
                  
                  bool sameDay = true;
                  
                  if (currentDate != Bars.GetTradingDayFromLocal(Time[0]) || currentOpen == double.MinValue)
                  {
                      currentLow        =    Low[0];
                      sameDay         =   false;
                  }
      
                  currentLow        =     Math.Min(currentLow, Low[0]);
                  
                  if (Low [0] < EMA (Close,20)[0] && Volume[0] > Volume[1] && Low[0] < currentLow)
      
                  {
                      
                      Values[0].Set(Volume[0]);
                      Values[1].Reset();
                      {PlaySound(soundFile);}
                  }
                  else
                  {
                      Values[1].Set(Volume[0]);
                      Values[0].Reset();
                  }
              }

      Comment


        #4
        Hello wxtrox7,
        To assist you further may I know what session template you have assigned to the strategy.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Stocks rth is the template. 930 To 4 pm EST

          Comment


            #6
            Hello wxtrox7,
            If you try the below code then are you able to get the correct values.

            //In Variables
            Code:
            double low = double.MaxValue;
            //in OnBarUpdate
            Code:
            protected override void OnBarUpdate()
            {
            	if (Bars.FirstBarOfSession) low = double.MaxValue;
            	Values[0].Set(VOL()[0]);
            	
            	if (CurrentBar < 1) return;
            	
            	low = Math.Min(low, Low[1]);
            	
            	if (Low[0] < low)
            		this.PlotColors[0][0] = Color.Red;
            }
            Also please do note, the low is always dynamically changing.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X