Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use the MIN/MAX() function w/data series, or return value between two time?

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

    #16
    Bars Back

    Hi Brett, it is a 13 period EMA which I'd like to start at market open so first part of ema wont plot until 39 mins in.

    Cheers
    DJ

    Comment


      #17
      djkiwi,

      To achieve that you will need to custom program yourself a completely new EMA indicator with that as the new logic. The current logic simply relies on weighting prior EMA values an appropriate weight and the new price a different weight. You will need to add some logic in between the session begin to start over.

      Probably something like this. (Note: This is untested code and is only designed to give you an idea of the direction to proceed)
      Code:
      if (CurrentBar == 0 || Bars.FirstBarOfSession)
           Value.Set(Input[0]);
      else
           Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Volume logic Between Session Issues

        Hi Guys, I am trying to calculate delta volume for the overnight session and am having problems. Please find attached the following chart. On it there are two sessions as follows:

        Session 1 : 13.30 - 6.30 am (Overnight session)
        Session 2: 6.30 am 13.15

        No I am trying to work out the volume delta ( that GOMCD chart below) for the overnight session in black. So what I want is that each day at 13.30 this will reset.

        Now I am able to do this with the code below ( and you can see the correct figures in magenta in each corner of the chart). I will just subtract one from the other to get the delta change.

        int barsAgo = GetBar(new DateTime(2011, 05, 31, 13, 30, 0));
        int barsAgo1 = GetBar(new DateTime(2011, 06, 01, 06, 30, 0));


        DrawTextFixed("Cum2",(gcdc.DeltaClose[barsAgo].ToString("N0")), brPosition,Color.White,textFontMed, Color.Black, Color.Magenta, 10);
        DrawTextFixed("Cum3",(gcdc.DeltaClose[barsAgo1].ToString("N0")), trPosition,Color.White,textFontMed, Color.Black, Color.Magenta, 10);

        I would like to do this automatically instead of having to change the date every day but have no clue how to do it. I have tried everything from the manual but no luck.

        Any ideas on this one?

        Thanks
        DJ
        Attached Files

        Comment


          #19
          DJ, you would need to custom code logic here for comparing today vs yesterdays values, for example using a negative .AddDays on a DateTime object will give you yesterdays date excluding weekend / holiday logic.

          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