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

Creating an indicator that will post on different chart type

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

    Creating an indicator that will post on different chart type

    Is it possible to create an indicator that reads information on a 3 minute chart (looking for simple moving average cross up or down to show trend direction) and have this register on a Range chart. I want this to be a background color change when it occurs.

    Thanks

    #2
    Welcome to our forums - yes that would be possible with our MultiSeries framework in NinjaScript for indicators and strategies :

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Welcome to our forums - yes that would be possible with our MultiSeries framework in NinjaScript for indicators and strategies :

      http://www.ninjatrader.com/support/h...nstruments.htm
      Is there any examples off hand that we can take a look at?

      Comment


        #4
        ij001, there are quite a few examples and some very helpful information in the link Bertrand posted. There are also multi-timeframe and multi-instrument strategy samples built into NinjaTrader. You can view these by going to Tools -> Edit NinjaScript -> Strategies -> SampleMulti...

        I had a script very similar to the one requested in the first post, so I modified it a bit as a quick demonstration. It just reads data from the secondary data series (BarsInProgress index = 1) and plots it on the main data series.
        Attached Files
        AustinNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Austin View Post
          ij001, there are quite a few examples and some very helpful information in the link Bertrand posted. There are also multi-timeframe and multi-instrument strategy samples built into NinjaTrader. You can view these by going to Tools -> Edit NinjaScript -> Strategies -> SampleMulti...

          I had a script very similar to the one requested in the first post, so I modified it a bit as a quick demonstration. It just reads data from the secondary data series (BarsInProgress index = 1) and plots it on the main data series.
          If i understand it corectly if you have any indicator and you add this line of code

          Add(PeriodType.Minute, 3);

          then it will do the calculations based on 3 minutes, and then should it be applied to any other charts it should reflect the calculations of the 3 min even on a 5min 15 min Range Tick Volume charts

          Is that correct because i seem to be having issues on some other script

          maybe i missed some other line of code

          Thank you

          Comment


            #6
            Hi richbois, that's not entirely correct - you simply add a series for access with this code snippet. I would then call the OnBarUpdate() method for each series added and each bar / tick - so if you do this unfiltered via any BarsInProgress logic it would create erratic results for you:



            This lets you split the OnBarUpdate() call for each series, so you could for example do nothing for the second series by returning out if the OnBarUpdate(0) is called for it, thus you would though still have access to it's series data.

            if (BarsInProgress != 0) return; // for any other series but the primary exit OnBarUpdate().
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thank you Bertrand that solved the problem second line was missing

              One last question can a Session Template be used in the calculation of the 3min charts then the results used on a 24/7 R or T chart

              Thanks again

              Comment


                #8
                Great, you're welcome - so cash hour based indicator values but running of a electronic hours chart? That would need more advanced custom coding unfortunately.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  Great, you're welcome - so cash hour based indicator values but running of a electronic hours chart? That would need more advanced custom coding unfortunately.
                  Thank you and have a great weekend

                  Comment


                    #10
                    Thanks, enjoy yours as well!
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Programming

                      I'm a programmer and I'd be interested in giving you a quote on this project. I've been wanting to do something similar over the last few days. Let me know!
                      lawyse
                      NinjaTrader Ecosystem Vendor - Affordable Indicators

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by RubenCazorla, 08-30-2022, 06:36 AM
                      3 responses
                      77 views
                      0 likes
                      Last Post PaulMohn  
                      Started by f.saeidi, Yesterday, 12:14 PM
                      9 responses
                      23 views
                      0 likes
                      Last Post f.saeidi  
                      Started by Tim-c, Today, 03:54 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post Tim-c
                      by Tim-c
                       
                      Started by FrancisMorro, Today, 03:24 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post FrancisMorro  
                      Started by Segwin, 05-07-2018, 02:15 PM
                      10 responses
                      1,772 views
                      0 likes
                      Last Post Leafcutter  
                      Working...
                      X