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

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,
        Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


        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
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rajendrasubedi2023, Today, 09:50 AM
              0 responses
              10 views
              0 likes
              Last Post rajendrasubedi2023  
              Started by ender_wiggum, Today, 09:50 AM
              0 responses
              4 views
              0 likes
              Last Post ender_wiggum  
              Started by bmartz, Today, 09:30 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by geddyisodin, Today, 05:20 AM
              3 responses
              24 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by lorem, Today, 09:18 AM
              1 response
              5 views
              0 likes
              Last Post lorem
              by lorem
               
              Working...
              X