Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame strategy/indicator question

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

    Multi Time Frame strategy/indicator question

    I am in the process of migrating my NT6.5 multi time frame strategies that only draw items and sound alerts.
    While migrating some of these, I noticed that they typically trigger correctly in real time but once I start scrolling back a couple of days, there are no indications that the strategy worked correctly.
    I did notice that if I refreshed the screen with an F5, the indicators displayed correctly.

    My question is, is this normal with the new way NT7 loads historical data or is there a different issue?

    I took a very simple example of exceeding the upper and lower Bollinger bands and it worked for the current day, but everything previously did not work.

    This strategy adds a 6 Range time frame and I execute this strategy on a 3 range chart.
    Code:
    protected override void Initialize()
            {
    
                CalculateOnBarClose = true;
    			Add(PeriodType.Range, 6);
    		}
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
    			if (BarsInProgress == 1)
    			{
    				if (High[0] >= Bollinger(2,300).Upper[0])
    				{
    					ShortReady = true;
    					DrawArrowDown("tagshort" + CurrentBar, true,0, High[0] + 7 * TickSize, Color.Red);
    				}
    				if (Low[0] <= Bollinger(2,300).Lower[0])
    				{
    					LongReady = true;
    					DrawArrowUp("taglong" + CurrentBar, true,0, Low[0] - 7 * TickSize, Color.LimeGreen);
    				}			
    			}

    #2
    gyoung,

    How are you determining that it is not working correctly? Your code is running off of your BIP=1 context which will not be in view on your chart so evaluating it visually would be hard. I suggest you add some Print() statements into your code and evaluate it by hand through checking the Output Window statements.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh, I tried to simplify this as much as possible because I was having timing issues with my entry and exits and tried to come up with an example that might shed light without all the complexities.

      I will add print statements and see where this takes us.

      Gary

      Comment


        #4
        OK, I have gone through the exercise of printing to the output window and verifying they the strategy is executing the code at the right points in time. My bad.

        What I also verified is that the drawn indicators do not work properly when you scroll back in time. I still have to refresh the screen to display them.

        I do a lot of regression analysis and this is somewhat annoying to have to refresh to spot my signals.

        Any suggestions on how to get the drawn objects to appear correctly?
        I am only using standard objects: Arrow, diamond, dot, ....

        Appreciate your help.

        Comment


          #5
          Josh will follow up on Monday.
          RayNinjaTrader Customer Service

          Comment


            #6
            No rush. Plenty more things to work on.

            Comment


              #7
              gyoung,

              What do you mean by the drawn objects not working properly? Can you please describe what happens instead of your expected behavior then? Thank you.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Josh,
                When I have a draw object based on a different time period, they draw correctly on the current screen being viewed but once you start scrolling back in time, they are not "necessarily" visable. I have to refresh the screen "F5" for the objects to become visable.

                I have print statements that show the indicators are triggering correctly but not drawing on the chart.

                I used a simple Bollinger example that can be recreated very easily.

                Comment


                  #9
                  This is the output from the strategy you created earlier with small print modifications.

                  **NT** Enabling NinjaScript strategy 'MTFDrawObject/04615e5d56324dcbaa8293b1f5bac3e4' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
                  1/13/2010 1:40:54 PM Arrow Down
                  1/14/2010 8:14:46 AM Arrow Down
                  1/14/2010 8:17:18 AM Arrow Down
                  1/18/2010 12:45:10 PM Arrow Up
                  1/18/2010 12:45:10 PM Arrow Up
                  1/18/2010 12:45:14 PM Arrow Up
                  1/18/2010 12:45:17 PM Arrow Up
                  1/18/2010 12:45:20 PM Arrow Up

                  Please see the attached screenshot, it shows the arrows at the correct time on the chart when I scrolled back. I zoomed out the chart so you can see them all. Please clarify what you are doing/seeing differently. Thank you.
                  Attached Files
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  628 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  359 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
                  562 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