Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA of custom indicator Index

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

    SMA of custom indicator Index

    Hi,
    pls can you help me how to display SMA(Index("ZW 07-14,ZW 09-14","1,-1",1,False,0),14) on the chart?
    The values of Index("ZW 07-14,ZW 09-14","1,-1",1,False,0) are displayed correctly on the chart - it is the spread between two ZWs. Active instrument (ZW 07-14) is selected as Input series.

    I've got the source code of indicator from here:

    search=spread&desc=1

    Thank you for the help.

    #2
    Hello harryx,

    Thank you for your patience.

    Took a little bit of playing with the settings to understand what is needed here. Please go to Tools > Options > Data > Merge Policy > DoNotMerge > OK. Then right click in the chart with the ZW 07-14 and the Index() indicator > select Reload All Historical Data.

    This will correct the plot. The plot is being based off of the merged historical data which has 09-14 using 07-14 data, this results in an invalid calculation. For information on Merge Policies please visit the following link: http://www.ninjatrader.com/support/h...rical_data.htm

    Comment


      #3
      Thank you for the reply, however I do have the merge policy set to DoNotMerge. Otherwise I wouldn't be able to work with individual contract months. Do you have any idea, what else could cause the problem in charting the indicator on indicator? Thank you.

      Comment


        #4
        Hello harryx,

        Thank you for your response.

        Please go to your Log tab of the NinjaTrader Control Center and report the error listed when you attempt to apply the indicator with this setup to your chart.

        In addition, please attach a screenshot of the chart with the indicator applied.

        To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image.

        Comment


          #5
          log:
          22.04.2014 22:41:29 Default Error on calculating indicator min/max value for indicator 'SMA'. Please check the 'GetMinMaxValues' method: Index was outside the bounds of the array.


          There is Index_Spread indicator in the screenshot. I just renamed Index to Index_Spread, for my convenience.
          Attached Files

          Comment


            #6
            Hello, pls did you happen to find out what the problem is with the charting I described below?
            Thanks a lot.

            Comment


              #7
              Hello harryx,

              Thank you for your response.

              I am seeing the same issue on my end now. I will follow up when I have additional details.

              Comment


                #8
                Hello harryx,

                Thank you for your patience.

                I had to create a new indicator and check ContainsValue(0) for a DataSeries I set with the SMA(Index(), 14). The code is below and I attached a screenshot of this on the chart.
                Code:
                        #region Variables
                		private DataSeries test;
                        #endregion
                
                        protected override void Initialize()
                        {
                			test = new DataSeries(this);
                			Add(new Plot(Color.Blue, "thisPlot"));
                        }
                        
                        protected override void OnBarUpdate()
                        {
                			test.Set(SMA(Index(1, false, 0, "ZW 07-14, ZW 09-14", "-1, 1"), 14)[0]);
                			if(test.ContainsValue(0))
                				Value.Set(test[0]);
                		}
                Attached Files

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by WHICKED, Today, 02:02 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by selu72, Today, 02:01 PM
                0 responses
                3 views
                0 likes
                Last Post selu72
                by selu72
                 
                Started by f.saeidi, Today, 12:14 PM
                8 responses
                21 views
                0 likes
                Last Post f.saeidi  
                Started by Mikey_, 03-23-2024, 05:59 PM
                3 responses
                49 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by Russ Moreland, Today, 12:54 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X