Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Session Begin and session End

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

    #16
    ytrender, sorry I didn't catch up earlier here with you - for what you look for I think the following is simpler to work with -

    Code:
     
    protected override void OnBarUpdate()
    {
    highLow.Set(CurrentDayOHL().CurrentHigh[0] - CurrentDayOHL().CurrentLow[0]);
    
    Plot0.Set(SMA(highLow, Bars.BarsSinceSession)[0]);
    
    }
    You would just need to define the highLow custom data series in the variables -
    Code:
     
     
    private DataSeries highLow;
    and Initialize() -

    Code:
     
    highLow = new DataSeries(this);
    Then it would return you an SMA with the length of bars into the current session over the developing session range.

    Comment


      #17
      Thank you Bertrand,

      Unfortunately I can't plot any values from your example?
      I don't understand , if I Plot indicator on 15 min timeframe how do I get a daily sma high-low range from code below? It looks to me this is a neat solution for intraday range. By DAILY I mean Yesterday+Monday+Friday....It should be really simple, except that it is'nt. Perhaps I was not clear in what I am trying to do?
      I just need to call daily SMA(MyRange,7) from any timeframe. That is why I have been looking at SampleGetHighLowByTimeRange example. But I dont know how to pass period to startTime and endTime

      Sorry for confusion,

      Thank you

      Gene

      Comment


        #18
        Gene,

        Please provide full code of what you have so far. Thank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          Hi Josh, Thank you for trying to help,

          This file is not mine, I simply tried to adapt the SampleGetHighLowByTimeRange to doing something like daily High-Low range for intraday timeframe. My Qestiones inside attached zip.

          Thank you very much,

          Gene.
          Attached Files

          Comment


            #20
            ytrender, thanks for posting - I'll take a look.

            Comment


              #21
              Gene, took at look at your code - are you on 6.5 or our 7 beta?

              This would be more straightforward on 7, as you then have access to multiple series and instruments in indicators, too. Whereas in 6.5 this is possible for strategies only, thus you could access the SMA of the daily High Low Range in a strategy and plot it via the Strategy Plot techniques (or just draw lines at your final buy / sell levels calculated).

              Comment


                #22
                Ninja Market Analyzer crash

                Hi everybody,

                I have never had this problem before, I am getting an error and exception in Market Analyzer with several studys that used to work just fine.
                In analyser property and label dont change to my custom indicator insted it crashes if I click apply
                Msg in Log Error on calling the OnBarUpdate for indicator... on bar 19;index was outside the bounds of array
                Failed to set property Indicator to market analyzer column...Exception has been thrown by the target of invocation????

                Appreciate any help,

                Thank you.

                Comment


                  #23
                  ytrender, those are the NinjaTrader 7 bug reporting / issue resolving forums here, could you please repost this in the regular forum under the Market Analyzer entry? I also just replied to your PM, please check your forum inbox. Thanks

                  Comment

                  Latest Posts

                  Collapse

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