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

storing temporary data

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

    storing temporary data

    Hello,
    what is the best way to store a date temporarily? Lets say i would like to store a trigger level where I want the strategy enter a position but when the setup is not valid any more (or have entered a position) I would like to reset the value to null and give it a value again when another setup arises.
    Thanks
    LazKz

    #2
    Are you looking to store DateTime value or just a price trigger level you had calculated? For the trigger level you could just use a double variable to store it...
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,
      I'm looking for a price level. I've tried to use a double variable but cannot assign null value to it therefore I had to set zero value for shorts and an extreme (or impossible) value for longs when the setup is not valid. I guess FloatSeries cannot be used for this purpose.

      Comment


        #4
        You could work with a DataSeries object holding doubles, you can set null values for those... http://www.ninjatrader-support.com/H...iesObject.html
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks, and the exact syntax to reset the value to zero would be

          mySeries.Set(null);

          Is that correct?
          Thanks

          Comment


            #6
            For the current bar just call the Reset() method for the dataseries - http://www.ninjatrader-support.com/H...iesObject.html
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            39 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            5 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            27 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X