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

dataseries integer values?

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

    dataseries integer values?

    Hi,

    I'm using the following code to store values into dataseries classes, the values being stored are "CurrentBar" numbers, thus they are integers. This seems to cause a problem (errors) with my code because the dataseries values should be "double" values (??)...can I get a clarification?...is it possible to setup "integer dataseries"??

    private DataSeries HI_StoK;
    HI_StoK = new DataSeries(this);
    ...
    if((VarStoch(3, 5, 3, 3).VarStoK[1] < 97) && (VarStoch(3, 5, 3, 3).VarStoK[0] >= 97))
    {NEW_HIGH = CurrentBar; HI_StoK.Set(NEW_HIGH);} //set "last high" (bars)
    ...
    if(HI_StoK[AI_index] < NEW_RISE){LO_CONSTRAINT = HI_StoK[AI_index];}

    #2
    Sure, please see this reference for IntSeries class.

    RayNinjaTrader Customer Service

    Comment


      #3
      Thank you, that helped.

      Comment


        #4
        Sorry, I have a follow-up question. It seems that my .Set commands are not properly being populated with the correct information (CurrentBar #)...my code is as follows, it seems the dataseries .Sets are all "0" instead of the CurrentBar number? Anybody got an idea as to why?

        private IntSeries LO_StoK;
        LO_StoK = new IntSeries(this);
        ...
        if((VarStoch(3, 5, 3, 3).VarStoK[1] > 3) && (VarStoch(3, 5, 3, 3).VarStoK[0] <= 3))
        {NEW_LOW = CurrentBar; LO_StoK.Set(NEW_LOW);}
        //set "last low" (bars)

        BTW: the integer value for "NEW_LOW" seems to store the correct value, however it is not updating to the LO_StoK dataseries...

        Comment


          #5
          Any errors in the Control Center logs?
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            No, however I believe I got this straightened out, thanks for the reply...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            18 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Working...
            X