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

Multi-Time Frames on One Instrument

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

    Multi-Time Frames on One Instrument

    After several days, it’s time to ask for help – thanks in advance! On a 10 Minute chart I’ve added 1000 Tick for the same instrument:
    protected override void Initialize()
    {
    Add(PeriodType.Tick, 1000);

    }
    Then two identical data access statements known to work on independent charts:
    double vB = (Highs[0][0]+Lows[0][0]+Opens[0][0]+(4*Closes[0][0]))/7;
    yB.Set(vB); // sets value to DataSeries for 10 Minute data
    double vBBase = EMA(yB,3)[0];

    double vC = (Highs[1][0]+Lows[1][0]+Opens[1][0]+(4*Closes[1][0]))/7;
    yC.Set(vC); // sets value to DataSeries for 1000 Tick data
    double vCBase = EMA(yC,3)[0];

    The first example above duplicates the value for the 10 Minute independent chart as expected.
    The second example above does NOT duplicate the 1000 Tick independent chart, and is yet a third value unlike the 10 Minute or the 1000 Tick. Suggestions how to access the 1000 Tick data? Thanks.

    #2
    Hello JulieC,

    Thank you for your post.

    Can you provide screenshots of what you expect the Plot of the vCBase to look like and what it currently looks like?

    I look forward to your response.

    Comment


      #3
      Hi PatrickH,
      The attached pic shows multiple lines. The Black Line is what the 1000 Tick bar data should generate, but rather it generates the Purple Line. The Emerald Green line is what the same calculations create if applied to a 10 Minute bar. The 1000 Tick bars are hollow in the background created by a separate independent overlay - which creates the Black Line. My objective is to manipulate bar color on the 10 Minute bars based upon the 1000 Tick Black Line.

      Thanks!!
      Attached Files

      Comment


        #4
        PatrickH,
        Perhaps there is something fundamental I'm missing. Please check out the attached pic that is the result of the following script:
        if(FirstTickOfBar) {
        DrawDot(
        "tenMinOpen"+CurrentBar,false,0,Opens[0][0],Color.Yellow);
        DrawDot(
        "tickOpen"+CurrentBar,false,0,Opens[1][0],Color.White);
        }

        There are about twice as many "Open[1][0]" as there should be - simply not that many 1000 Tick bars.
        The number of "Open[0][0]" is correct.
        Attached Files

        Comment


          #5
          Hello JulieC,

          Thank you for your response.

          Can you attach the full indicator to your response so I may investigate this matter further on my end?

          You will find the indicator located in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Indicator

          If you prefer you can send the indicator to support[at]ninjatrader[dot]com with 'ATTN: Patrick - 967570' in the subject line and a reference to this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=62446

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          435 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          3 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frslvr, 04-11-2024, 07:26 AM
          9 responses
          127 views
          1 like
          Last Post caryc123  
          Started by selu72, Today, 02:01 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X