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

General question

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

    General question

    Hi all.

    A general question from someone that is somewhat useless with writing NT script.

    Is it possible to reference an indicator settings from larger time frame charts on a smaller time frame chart ?

    ie: have an indicator, with it's settings the same, on say a 60min, 30min and 5min chart showing up on a 1min chart ?

    thx

    #2
    Not using an indicator, not with NT 6.5.

    You can do it using a strategy. The end result is pretty much the same, it's just more work and extra steps. Don't let the word strategy fool you -- you don't have to use them to trade, they can still plot values on charts for you just like an indicator. I do this now with some of my stuff so an indicator has the same values across multiple charts.

    I think I've covered how to do it in some of my blog posts, but basically you write a strategy that uses multiple Add(PeriodType) statements, and then grab values from those BarsArrays.

    NT7 is supposed to fix this, making multi-time frame indicators possible on a chart, instead of having to resort to the strategy hack method.

    If you need this now and aren't good at NinjaScript, I am sure a consultant can put it together for you.

    Mike

    Comment


      #3
      thx

      Thx for for replying so quickly and for clarification re: using strategy.

      So lets assume I have an macd zero line cross study.

      I have a 1min chart up but want to see in study window at bottom of chart a series of dots that colour (red for down and green for up) depending on the macd zero cross for say a 60min, 30min and 5min chart.

      The dots would create a horizontal line (like building a wall) for each slower time frame as each bar builds for the time frame I am on (in this case a 1 min) .

      This I can do via create strategy (rather than create indicator) ?

      Comment


        #4
        There have been discussions on the "issues" of placing strategy based plots in a panel other than panel #1. Ray provided a "possible" unsupported workaround but I don't think it was ever tested, at least not by me.

        If you can live with the plots being in panel 1 (price panel) in some fashion there should be no problem. ie: a text box based window, or just plots along the top or bottom of the panel.

        At any rate, I will let a Ninja consultant respond from here since you're getting specific.

        Mike

        Comment


          #5
          thx

          Ideally, yes, in it's own panel 2.
          Thx for your feedback Mike.

          (checking out your blog )

          Comment


            #6
            ..

            OK bare with my ignorance here..

            I believe I've created something via the strategy root (for an indicator).
            followed through the wizard until the Finish button.

            Problem I have is that it's not listed under the Indicators list when I right click the chart.
            Also when I right click the chart the "Strategy" title is grayed out.

            So where is the indicator (strategy) I created and how do I apply it to the chart.?
            (basic stuff I know but you have to start somewhere)
            thx

            Edit: I found it in a "strategy" folder.
            I've opened it via the code button on wizard and "compiled" it but still have same issue re: not listed as an indicator and strategy grayed out..?

            If anyone wants to spare me the misery..
            This is what I want as an indicator, line on the chart (panel 1 ).

            50-bar CCI and looks to see if it is above/below zero. Then it adds or subtracts a (by default) 5-bar ATR. That colors red/blue accordingly.
            Last edited by dj22522; 06-06-2009, 04:52 PM.

            Comment


              #7
              It is a ninja limitation, you have to be connected to a data provider or market replay to view strategies on a chart.

              Mike

              Comment


                #8
                Thanks for stepping in Mike - correct you need to be connected live to start a strategy from the tab or chart.

                NinjaTrader 7 will offer MultiSeries charting capabilities.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  --

                  Originally posted by ctrlbrk View Post
                  It is a ninja limitation, you have to be connected to a data provider or market replay to view strategies on a chart.

                  Mike
                  Thx Mike and Bertrand.
                  Would this include the Gain Demo data ?
                  Presently connected to it but still no joy.
                  Right click chart and "Strategy" still grayed out.

                  ??
                  thx

                  Comment


                    #10
                    This should work on the Gain / Forex.com connection - which currency did you select? Is this chart updating properly? Also please make sure to disable the ChartTrader panel...
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      --

                      Originally posted by NinjaTrader_Bertrand View Post
                      This should work on the Gain / Forex.com connection - which currency did you select? Is this chart updating properly? Also please make sure to disable the ChartTrader panel...
                      Any currency selected. Same problem.
                      Yes chart updating.
                      How do I disable ChartTrader panel. (Don't know what this is) ?

                      Thx

                      Comment


                        #12
                        Double click on the chart to get into the 'Properties', then make sure to set 'Show chart trader' to false. Then recheck if the 'Strategies' button becomes available. If not it would best you contact us at support at ninjatrader dot com with the license key you use (Help > License Key).
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by dj22522 View Post
                          Any currency selected. Same problem.
                          Yes chart updating.
                          How do I disable ChartTrader panel. (Don't know what this is) ?

                          Thx
                          Edit:
                          Understand re: ChartTrader.
                          Disabled it and "Strategy" now NOT grayed out.

                          Now just need to learn how to code this, but the CCI50(zero line cross) with 5 ATR as a Red/Green color line on the chart, I only need as an indicator. Any helpers out there..?
                          Until I figure out the Multi Time Frame stuff indicator.

                          Many thx Bertrand

                          Comment


                            #14
                            Great, thanks for reporting back - you can start with our indicator coding tutorials posted here - http://www.ninjatrader-support.com/H...verview18.html
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              --

                              Originally posted by NinjaTrader_Bertrand View Post
                              Great, thanks for reporting back - you can start with our indicator coding tutorials posted here - http://www.ninjatrader-support.com/H...verview18.html
                              Trying to make sense from those links.
                              But one stage at a time this is what I have so far just for the CCI.
                              I will need to add the 5 ATR bit afterwards.

                              Don't know why the CCI is not coloring Red/Green re: the zero line cross ?
                              It's all red line regardless of above or below zero line.
                              ------------------------------------------------------------------------

                              #region Variables
                              // Wizard generated variables
                              private int period = 50; // Default setting for Period
                              // User defined variables (add any user defined variables below)
                              #endregion

                              /// <summary>
                              /// This method is used to configure the indicator and is called once before any bar data is loaded.
                              /// </summary>
                              protected override void Initialize()
                              {
                              Add(new Plot(Color.FromKnownColor(KnownColor.Chartreuse), PlotStyle.Line, "AboveZero"));
                              Add(new Plot(Color.FromKnownColor(KnownColor.Crimson), PlotStyle.Line, "BelowZero"));
                              Add(new Line(Color.FromKnownColor(KnownColor.Fuchsia), 0, "ZeroLine"));
                              Period = 50;
                              //Set the threshold values for eash plot
                              Plots[0].Min = 0;
                              Plots[0].Max = 0;

                              CalculateOnBarClose = true;
                              Overlay = false;
                              PriceTypeSupported = false;
                              }

                              /// <summary>
                              /// Called on each bar update event (incoming tick)
                              /// </summary>
                              protected override void OnBarUpdate()
                              {

                              //Are there enough bars
                              if (CurrentBar < Period) return;
                              // Use this method for calculating your indicator values. Assign a value to each
                              // plot below by replacing 'Close[0]' with your own formula.
                              AboveZero.Set(CCI(Period)[0]);
                              BelowZero.Set(CCI(Period)[0]);
                              }

                              #region Properties
                              [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                              [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                              public DataSeries AboveZero
                              {
                              get { return Values[0]; }
                              }

                              [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                              [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                              public DataSeries BelowZero
                              {
                              get { return Values[1]; }
                              }

                              [Description("Number of periods")]
                              [Category("Parameters")]
                              public int Period
                              {
                              get { return period; }
                              set { period = Math.Max(1, value); }
                              }
                              #endregion
                              Last edited by dj22522; 06-08-2009, 05:40 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by judysamnt7, 03-13-2023, 09:11 AM
                              4 responses
                              55 views
                              0 likes
                              Last Post DynamicTest  
                              Started by ScottWalsh, Today, 06:52 PM
                              4 responses
                              35 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by olisav57, Today, 07:39 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post olisav57  
                              Started by trilliantrader, Today, 03:01 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post helpwanted  
                              Started by cre8able, Today, 07:24 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X