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

Working with Dataseries

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

    Working with Dataseries

    When you work with dataseries, you are storing a historical data set to work things like SMA that need history, correct

    Variables are just datastorage that wont carry a history beyond the event that triggers the script,correct

    So why when I .set the dataseries Volumeseries.Set(VolumeData/5);

    VolumeData being the variable that I collect in the loop.

    So why does
    //Values[2].Set(VolumeData/5);
    work and produce a histogram
    and
    Values[2].Set(Volumeseries[0]);
    Setting the history at 0 does not?

    I am using first tick of bar, but the data should be there.

    Because I want to smooth the dataset via sma, so where is my data?

    Values[2].Set(SMA(Volumeseries,3)[0]);

    This works but I cannot smooth the data
    //Values[2].Set(VolumeData/5);



    if (FirstTickOfBar)
    {
    timeOfInterest = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, Time[0].Hour, Time[0].Minute, 0);

    barsAgo =0;
    VolumeData=0;
    for (int x = 1; x < 5; x++)
    {
    barsAgo = GetBar(timeOfInterest.AddDays(-x));
    VolumeData=Volume[barsAgo]+VolumeData;
    }
    Volumeseries.Set(VolumeData/5);
    }

    if (CurrentBar> barsAgo)
    {
    //Values[2].Set(VolumeData/5);
    Values[2].Set(Volumeseries[0]);
    }

    #2
    Ah I did not set the dataseries...

    Tradestation programmer you see

    Comment


      #3
      Tinkerz, just to clarify, you've found a solution to your issue?
      AustinNinjaTrader Customer Service

      Comment


        #4
        Yes thanks

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,408 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Working...
        X