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

codes for different time frames

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

    codes for different time frames

    Hello,
    Is it possible to create a time base strategy for a Particular time period chart but run it on a different time period chart?
    Anotherwords is it possible to create an action to be taken the bar stamped 10:34 am (like drawing a horizontal line from its' high) but run this code on a 15 min chart?

    #2
    Not sure I follow. When you run on a 15min chart you can only work based off of the timestamps you receive from that chart. You would not receive a 10:34 timestamp.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      The indicator I am trying to make is suppose to do some visual tasks like drawing lines from the the open/high/low/close of a few specific 1 min bars. But since the bars that they are being drawn from can't fit on the screen (need substantial chart compression) I am looking for a way to run this task on a longer period chart like a 15 min bar chart but remember the lines are still going to be drawn from the values of the 1 min bars.
      Is this possible?

      Comment


        #4
        Nope. Only way is if you have a real-time chart and you run with CalculateOnBarClose. Then you can check your PC clock and then just save the value at 10:34. This would not work with historical bars since you do not have the intrabar granularity.

        Multi-time frame indicators will be available in NT7.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          In that case is there any way I can filter part of the data so the 1 min chart gets truncated? Let's say I want to view the i min chart for Monday through Friday but I want to delete/filter the data for tuesday & Wednesday.

          Comment


            #6
            You can only filter with dates. ToDay(Time[0]) will give you the date of the current bar. If the date lies on a Tuesday or Wednesday then don't process your strategy logic.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              No I meant that I want to trucate the chart.That means I only want to view the bars for only certain dates.This would have nothing to do with the running strategies.

              Comment


                #8
                Only way you can do that is to delete the data from your database. Tools->Historical Data->Delete. If you pull data from your data provider after you do this it will repopulate those dates.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  This option doesn't work.
                  I opened a chart of ES going back 15 days then from the Control Center I went to Tools>Historical Data> Delete and deleted all the data except the first day and the last day but when I came back to the chart , the same number of days were visible.
                  Am I doing something wrong?

                  Comment


                    #10
                    You can't have any charts of the instrument open when you delete.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Got it. thanks.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by CortexZenUSA, Today, 12:53 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by CortexZenUSA, Today, 12:46 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by usazencortex, Today, 12:43 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post usazencortex  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      168 responses
                      2,266 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      13 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X