Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PriorWeekOHLC does'nt work on daily chart

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

    PriorWeekOHLC does'nt work on daily chart

    Hi,
    I am examining the code of the PriorWeekOHLC indicator , as I found it on this forum (http://www.ninjatrader.com/support/f...php?linkid=540).

    It is pretty straightforward, but the only thing I can't figure out is why it does'nt work on daily charts, even if I eliminate the intraday filter condition ( if(!Bars.BarsType.IsIntraday) return; .

    I am sure I am missing something as the standard indicator PriorDayOHLC uses the same intraday filter condition. But why do we have to rule out Daily charts? As I work on DateTime objects to calculate next week start and then roll back currentOHLC to PreviousOHLC, should'nt it work in daily charts too? ... can you help?

    Thanks
    Andrea

    #2
    Hello afoschini,

    Thank you for your note.

    I added a secondary 60 minute series to the script which will allow you to display last weeks levels on a daily chart as well as intra day.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your help.

      Can you please you please explain why it was'nt working without the additional 60' data series?
      I still does'nt have a clue. It was working om on 30' or 60' prima data series but not on daily data series.

      Thanks

      Comment


        #4
        Hello afoschini,

        Aside from the return statement if its not intraday chart, the indicator loops from left to right saving the highest value between each week. I would speculate the reason had to do with the time conditions.

        For a more in depth understanding I would suggest you add print statements to the script to understand the behavior, below is a video which covers this,


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Thank you for the clue Alan. I will dig into it.
          Andrea

          Comment


            #6
            Originally posted by NinjaTrader_AlanP View Post
            Hello afoschini,

            Thank you for your note.

            I added a secondary 60 minute series to the script which will allow you to display last weeks levels on a daily chart as well as intra day.

            Please let us know if you need further assistance.
            Could this be tweaked where it only looks back 1 bar rather than 256 to avoid cluttering up the chart? Just want to see last weeks OHLC. Thank you.

            Comment


              #7
              Hello jasonw,

              Thanks for your notes.

              No, the MaximumBarsLookBack property is only able to be set to MaximumBarsLookBack.TwoHundredFiftySix or MaximumBarsLookBack.Infinite.

              See this help guide page for more information about the MaximumBarsLookBack property: hehttps://ninjatrader.com/support/helpGuides/nt8/maximumbarslookback.htm
              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment

              Latest Posts

              Collapse

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