• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dataseries plotted as indicators

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

    Dataseries plotted as indicators

    Two separate, but related, issues.

    1. Let's say my strategy involves checking the VIX volatility index, so in effect this dataseries serves as an indicator. Both the primary dataseries and VIX are daily data. What is the preferred way to:
    (i) incorporate this data into my strategy? I.e., how do I call it?
    (ii) plot this data - can I plot it as an indicator?
    (iii) the primary dataseries will go back further than VIX data - does this pose a technical problem or will it simply be the case that the VIX plot will have no data for dates earlier than those for which VIX data is available?

    2. I have a custom dataseries (daily data - 1 data point per trading day) in a spreadsheet that I'd like to import into an indicator.
    (i) How can I do this?
    (ii) And I'd need to manually update every day - I suppose by updating the spreadsheet and running the import process, unless there is an easy way to append the dataseries directly in NT itself?

    #2
    Hi dolomite,

    The VIX is an index that can be added as an instrument data series and is not an indicator (in the sense of NinjaTrader indicator scripts). Are you wanting to add this as a secondary series to your script?
    If so, use Add() to add this to your script.
    Add("^VIX", PeriodType.Minute, 1);
    http://ninjatrader.com/support/helpGuides/nt7/add3.htm

    if (BarsInProgress == 1)
    {
    Print(Close[0]);
    }

    if (BarsInProgress == 0)
    {
    Print(Closes[1][0]);
    }

    Yes, you can set the value of a plot to the price of the index.
    Value.Set(Closes[1][0]);

    The script will start when both series have data, so yes, this would present a problem for backtesting.

    Importing data into NinjaTrader has to be done with a very specific file name and contents format.
    Below is a link for importing data. If it is not in this format it will not import.
    http://ninjatrader.com/support/helpG.../importing.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Importing data into NinjaTrader has to be done with a very specific file name and contents format.
      Below is a link for importing data. If it is not in this format it will not import.
      http://ninjatrader.com/support/helpG.../importing.htm
      A couple of questions on using imported data:

      1. If I have a custom daily dataseries that has only a 'close' level for each day, I still have to import it using "date;open;high;low;close;volume" format, it seems. No option to import it as simply "date;close"? Obviously, I can use dummy values for open/high/low/volume, but figured I'd ask if there was a way to avoid that step.

      2. I understand from your post how I can add this dataseries as a secondary series to my script by using the Add() method. Can I plot this custom dataseries as an indicator style chart that sits below a primary dataseries chart?

      Comment


        #4
        Hi dolomite,

        Yes, you can set the value of a plot to the price of the index.
        Add("^VIX", PeriodType.Minute, 1);
        Add(new Plot(Color.Blue, PlotStyle.Line, "VIXPlot");

        if (BarsInProgress == 1)
        {
        Value.Set(Closes[1][0]);
        }

        In a new indicator that has a plot, set the plot value to the value of the VIX.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I just realized you can add multiple instruments of the same time frame to a chart simply by right clicking on the chart > Data Series and selecting an additional data series.
          Last edited by dolomite; 03-15-2016, 11:45 PM.

          Comment


            #6
            Hi dolomite,

            I did not address your inquiry from post # 3.
            No, when importing there would not be a way of skipping that step. I imagine that a script could be written to read in the file you have, correct the line and write it to a new file using the StreamReader and StreamWriter. If the file is large, it may take less time to write the script that edit the file by hand.

            Regarding the ^VIX, yes you can add this or any data series as a secondary series (or third series) to your chart. This is what the New button is for in the Data Series window. You could choose to show this as a line on close. However, this would not be an indicator that could be applied with a template. You would need to manually add this to each individual chart.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Trade95, Yesterday, 05:38 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by Karelgp7, Yesterday, 03:16 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by orenytz, Yesterday, 01:18 PM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by des.kkeng, Yesterday, 01:10 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by Capablanca, Yesterday, 12:35 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X