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 frame indicator

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

    Multi Time frame indicator

    I have a indicator running on a 1min chart that changes the color of the bars whenever a volume condition is met. Now i want to change the colors of the bars on a constant volume chart whenever the same volume condition is met on the 1min chart.


    I understand how to approach this but I am not sure about the specific. I know that I have to create a new indicator and add the 1min bar object to the indicator. But how do I refference Volume[0] from the 1min chart, and actually paint the bars on the volume chart ?

    #2
    Hi trader413,

    The basic framework for multiseries NinjaScript is available in all platforms. Click Tools > Edit NinjaScript > Strategy > Open SampleMultiTimeFrame. Documenation for this is available here:


    Volume for a secondary series can be accessed using:
    Volumes[1][0]

    You can also use a BarsInProgress filter to define the context of bar updates.

    if (BarsInProgress == 1) //Seconday series or first added series.
    double myVolume = Volume[0];
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok thanks for the reply. I tried your approach but still having some problems.

      Why am I not getting the value for BetterVolume3(10,true,true,true).VolEMA[0] from the 1min chart ?

      "betterVolAve" remains 0 in the output window.



      protected override void Initialize()
      {
      Add(PeriodType.Minute, 1);


      Add(new Plot(Color.FromKnownColor(KnownColor.Tomato), PlotStyle.Line, "SPOI"));
      Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "LPOI"));
      Overlay = false;
      CalculateOnBarClose = false;
      }

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      if (BarsInProgress == 1)
      {
      myVolume = Volume[0];
      Print(myVolume);
      }

      if (BarsInProgress == 1)
      {
      BetterVolume3(BarsArray[1],10,true,true,true).VolEMA[0] = betterVolAve;
      Print( betterVolAve + "......Ave");
      }

      Comment


        #4
        I don't see any issues with the code. Are you getting any error messages in log tab of control center? What is the value for myVolume printed? How does it look when you manually apply this indicator to a 1 minute series?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I am applying it to a constant volume chart. myVolume is working correctly and printing the correct value. the problem is with "betterVolAve", its not getting the value from the indicator on a 1min series. Its value remains 0.

          Comment


            #6
            Great the basic functionality is working for you. Unfortunately we could not advise how to see it working with the custom script. We are not familiar with the inputs expected, or how it may be used in a multiseries scripts. Best is to contact the author or vendor. Let them know how you plan on using their script and see if they have any further advice.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              But all I am trying to do is to access that data from a different time series. Thats all, I have reference this indicator in other custom indicators without a problem. its just a matter of figuring how to access its 1min calculations from a constant volume chart .

              Comment


                #8
                We can't advise how to work this using custom scripts. The issue could be anything.

                Here is similar functionality using the built in SMA indicator to calculate a simple moving average of volume from a secondary series:

                double mySMAVolume = SMA(Volumes[1], 14)[0];
                Last edited by NinjaTrader_RyanM1; 07-18-2011, 11:37 AM.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by wzgy0920, 04-20-2024, 06:09 PM
                2 responses
                26 views
                0 likes
                Last Post wzgy0920  
                Started by wzgy0920, 02-22-2024, 01:11 AM
                5 responses
                32 views
                0 likes
                Last Post wzgy0920  
                Started by wzgy0920, 04-23-2024, 09:53 PM
                2 responses
                49 views
                0 likes
                Last Post wzgy0920  
                Started by Kensonprib, 04-28-2021, 10:11 AM
                5 responses
                193 views
                0 likes
                Last Post Hasadafa  
                Started by GussJ, 03-04-2020, 03:11 PM
                11 responses
                3,235 views
                0 likes
                Last Post xiinteractive  
                Working...
                X