Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            87 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            131 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            106 views
            0 likes
            Last Post CarlTrading  
            Working...
            X