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

pivate DataSeries vs. double

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

    pivate DataSeries vs. double

    What is more efficient to use if i need ie. 4 historic values of an indicator for my strategy :

    should ia create a pivate DataSeries like this

    private DataSeries myECO2;
    myECO2 = new DataSeries(this);
    myRSX.Set(ECO2(21,45,8,6)[0]);

    or

    should i use this style of coding to get my four needed values
    - just right in the OnBarUpdate()-section :

    double eco01 = (ECO2(21,45,8,6)[1]);
    double eco02 = (ECO2(21,45,8,6)[2]);
    double eco03 = (ECO2(21,45,8,6)[3]);
    double eco04 = (ECO2(21,45,8,6)[4]);

    Thanks for an idea
    max-td

    #2
    Go with the doubles if you don't need more history for the ECO or if you don't need to 'feed' into another method accepting only dataseries inputs.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      ok thanks for the info

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by thumper57, Yesterday, 04:30 PM
      7 responses
      22 views
      0 likes
      Last Post thumper57  
      Started by morrnel, Today, 06:07 PM
      2 responses
      18 views
      0 likes
      Last Post morrnel
      by morrnel
       
      Started by sastrades, 05-10-2024, 09:59 AM
      3 responses
      55 views
      0 likes
      Last Post rc5781
      by rc5781
       
      Started by guyonabuffalo, Yesterday, 10:01 PM
      2 responses
      22 views
      0 likes
      Last Post guyonabuffalo  
      Started by reynoldsn, 05-10-2024, 07:04 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X