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 andrewtrades, Today, 04:57 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X