Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sync non-time based data series

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

    Sync non-time based data series

    Hello & good day.

    Is there a way to have ES & VIX plot (non-time based bars) on the same chart (separate panels) but be in sync? I've included a pic with a note to illustrate the issue?

    If it's a matter of having a custom C# solution coded, that's fine too. Is there a better way for me to explain the question to a 3rd paty?

    Thank you in advance, JM
    Attached Files

    #2
    Hello,

    Thank you for the post.

    In this case there would not be a way to have the chart display the bars in sync between the two different instruments as equidistant spacing can not be enabled. Additionally these are two different instruments which may have very different price movement. Because this type of chart is based on price movement there may be different number of bars as well like the image you have provided. The effect of having two separate charts open and compared one above another could not be replicated as cleanly in a single chart with one time scale unfortunately.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Re: Jesse

      Thank you Jesse.

      How about this then? Let ES plot based on whatever non-time based bars (for example P&F or Renko). Then plot the VIX from those ES columns rather than P&F settings.

      It's easy enough to know the time and price an ES P&F column changes from X's to O's. It's also easy to know what the VIX did during that time. VIX wouldn't be constrained by P&F or Renko parameters. It would simply move up and down in it's own column until the ES P&F switched back to a column of X's.

      This approach will definitely plot the 2 data series how I'd like to but how can i do that?

      Put another way, ES will plot based on P&F parameters but VIX will be time based. Although the VIX X and O columns will be time based, they won't be a static 1min, 5min or 15min bars. They will vary based on how long it takes ES to meet the P&F criteria to change from X's to O's or vice versa.

      Is there a way to code that in C#?

      Thanks again, JM

      Comment


        #4
        Hello johnnymustard,

        What you are describing is a challenge, but as a hint, you could include a C# dictionary as a global scope object. The dictionary's keys could then be unique times, which could in turn be sorted and read in order into a data series. Doing so would involve three skills : accessing the global scope, using C# dictionaries, and using NinjaTrader Data Series.

        As far as accessing the global scope, for NinjaTrader 7, this is very easy. We provide the files (My) Documents\NinjaTrader 7\bin\Custom\Indicator\UserDefinedMethods.cs and (My) Documents\NinjaTrader 7\bin\Custom\Strategy\UserDefinedMethods.cs . You can store global variables that will be included for all Indicators in this file. Make sure they are part of the Indicator class. For example,


        partial class Indicator
        {
        /// <summary>all the plots from all the indicators</summary>
        public static Plot[][] allThePlots;
        }



        NinjaTrader 8 will not have a similar file. I am including a publicly available link from the MSDN C# documentation which will guide you toward putting together a global scope file in NT8.

        The C# namespace alias qualifier `::` is used to access a member of an aliased namespace. The `::` operator is often used with the `global` alias, an alias for the global namespace


        Whichever way you choose, you will want to add some logic surrounding your global objects.

        As far as C# Dictionaries are concerned, documentation for these can be found here



        Finally NinjaScript DataSeries can be found documented here,





        Please let us know if there are any other ways we can help.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          RE: JessicaP

          Thank you JessicaP. I will take what you've given me and see if I can get this up and running. JM

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by chbruno, Today, 04:10 PM
          0 responses
          3 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          6 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frslvr, 04-11-2024, 07:26 AM
          9 responses
          127 views
          1 like
          Last Post caryc123  
          Working...
          X