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

Transfer Plot Values

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

    Transfer Plot Values

    Hi

    I simply want to transfer custom plot values (times three) from a 30m chart to a 1m chart.

    Could you point me in the right direction please?

    many thanks

    #2
    Hello,

    Thanks for the forum post.

    Are you a programmer are you wanting to access these values progromatically?

    Or are you wanting to apply this indicator to the chart with the platform?

    -Brett

    Comment


      #3
      programming please

      I create the custom plots via a ninjascript indicator on a 30m chart but I want to see the results on a 1m chart (without trying to recreate the whole 30m indy in the 1 m chart via ADD etc).

      I would also like to transfer values from a different instrument (say 30m YM chart) to a 1m ES chart.

      thanks

      Comment


        #4
        Hello I_Quant,
        Welcome to the forum and I am happy to assist you.

        You can calculate the data series based on a 30 minute chart and plot the same on a 1 minute chart by creating a multi-series indicator.


        Please refer to this sample code attached along-with to get more idea.

        Also please refer to these help guide tutorials for this purpose




        Please let me know if I can assist you any further.
        Attached Files
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          thanks joydeep but I'm just not getting this. I know it should be simple but please bear with me.

          I have an Indicator that works on a 30m chart. It creates up to 12 plots (maybe more in the future), I would like to transfer only 3 of those plot values onto a 1m chart. The indicator has many parameters that control all sort of things inside the indicator.

          I can see how the ADD/SET works for something like a standard SMA or other simple Ninja Indicator but I don't see how I can just use a SET for 3 of the 30m plots inside the 1m chart. I can see that this would be exactly what I want - for example in the 1m chart ADD (PeriodType.Minute,30); Plot1Value.Set(CustomIndicator(Plot1ValueSomehow)) and so on for Plot2 and Plot3.

          I'm just not seeing how I can access those Plot values in the 30m chart from the 1m chart.

          thanks for your patience.

          Comment


            #6
            Hello I_Quant,
            You can either filter the bars and set the plots for the desired data series only or you can Reset the data-series values when not needed. This way you can plot the values of the data series which you only want to show.

            Like
            Code:
            Plot1Value.Reset(barsAgo);


            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Originally posted by I_Quant View Post
              thanks joydeep but I'm just not getting this. I know it should be simple but please bear with me.

              I have an Indicator that works on a 30m chart. It creates up to 12 plots (maybe more in the future), I would like to transfer only 3 of those plot values onto a 1m chart. The indicator has many parameters that control all sort of things inside the indicator.

              I can see how the ADD/SET works for something like a standard SMA or other simple Ninja Indicator but I don't see how I can just use a SET for 3 of the 30m plots inside the 1m chart. I can see that this would be exactly what I want - for example in the 1m chart ADD (PeriodType.Minute,30); Plot1Value.Set(CustomIndicator(Plot1ValueSomehow)) and so on for Plot2 and Plot3.

              I'm just not seeing how I can access those Plot values in the 30m chart from the 1m chart.

              thanks for your patience.
              Can you post the whole calling signature of the indicator that you are trying to call? I need to see the parameters before I may be able to offer a suggestion.

              Comment


                #8
                thanks koganam I think I managed to figure it out - at least enough to see my lines transferred from the 30 to the 1m. I did this in the receiving indicator (didn't touch the sender)

                Add(PeriodType.Minute,30); // In Initialize()

                In OnBarUpdate()
                {
                if (CurrentBar < 1) return;
                if (BarsInProgress==1)
                {
                Plot1.Set(Sender_Indicator_30m().Values[4][0]); // default to Instrument, Close of 30m Period
                Plot2.Set(Sender_Indicator_30m().Values[3][0]);
                Plot3.Set(Sender_Indicator_30m().Values[5][0]);
                }

                Seems to do the trick. Don't need any parameters inside the Sender (30m) Indicator call, I guess its defaulting to use this indicator's instrument and the default data input type (Close) plus, because I am only looking at it through the eyes of the BarsInProgress==1 then its using the 30m period. Anyway the values seem to match those on the 30m chart which was the objective.

                But if you see something silly or just plain lucky here, please don't hesitate to jump in.

                I guess I could have called the external indicator for a different instrument by adding a BarsSeries for that instrument through an ADD("Instr Code", PeriodType etc) and then going through similar if (BarsInProgress== ) logic ? (will try this later)

                thanks for your offer of help.
                Last edited by I_Quant; 02-28-2012, 07:19 AM.

                Comment


                  #9
                  and thank you joydeep

                  Comment


                    #10
                    Hello I_Quant,
                    Glad you could figure it out.
                    Please let me know if I can assist you any further.
                    JoydeepNinjaTrader Customer Service

                    Comment


                      #11
                      so Joydeep or koganam

                      now that I have my plot working is there a way to prevent it being "erased" if I go into the receiving chart to change colors/line lengths and so on? i.e. to make it completely persistent on the chart no matter what ?

                      thanks

                      Comment


                        #12
                        Originally posted by I_Quant View Post
                        so Joydeep or koganam

                        now that I have my plot working is there a way to prevent it being "erased" if I go into the receiving chart to change colors/line lengths and so on? i.e. to make it completely persistent on the chart no matter what ?

                        thanks
                        In the calling indicator, you are explicitly setting the Plots. That means that they belong to the class, and have nothing to do with the chart, except for their inherited and gated dependence on the actual price bar series.

                        Comment


                          #13
                          thanks.

                          If I asked you to rephrase that would you take offence ?

                          Does this give me a way to keep the plots showing on the chart or not?

                          thanks for trying to help

                          Comment


                            #14
                            Hello I_Quant,
                            When you call something like
                            Code:
                            Plot1.Set(Sender_Indicator_30m().Values[4][0])
                            Then it calculates the value based on the chart on which it is initialized, and not on the secondary data series as no where the secondary data series is referenced.

                            To simplify, lets take the Bollinger band indicator for example which have 3 plot values (Upper, Bollinger, and Lower). Now say you want to put the values of the Upper plot as calculated on a 30 minutes bar on a one minute chart.

                            Then the same will be like:
                            In Initialize add the secondary data series
                            Code:
                            Add(PeriodType.Minute, 30);
                            And in OnBarUpdate set the plot as
                            Code:
                            protected override void OnBarUpdate()
                            {
                                  if (CurrentBars[1] < 0) return;
                            
                            	if (BarsInProgress == 0)
                            	{
                            		UpperB.Set(Bollinger([B][COLOR="Blue"]Closes[1][/COLOR][/B], 2, 14).Upper[0]);
                            	}
                            }
                            Closes[1] as highlighted in Bold/Blue makes sure the Bollinger band is calucated based on the secondary data series.

                            Please let me know if I can assist you any further.
                            JoydeepNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by I_Quant View Post
                              thanks.

                              If I asked you to rephrase that would you take offence ?

                              Does this give me a way to keep the plots showing on the chart or not?

                              thanks for trying to help
                              No offence taken. That was a rather verbose answer. The simple answer is that Plots will always show on the chart, so you should be fine.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cre8able, Yesterday, 01:16 PM
                              3 responses
                              11 views
                              0 likes
                              Last Post cre8able  
                              Started by ChartTourist, Today, 08:22 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post ChartTourist  
                              Started by LiamTwine, Today, 08:10 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post LiamTwine  
                              Started by Balage0922, Today, 07:38 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Balage0922  
                              Started by JoMoon2024, Today, 06:56 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post JoMoon2024  
                              Working...
                              X