Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataSeries and variables naming and behavior questions

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

    DataSeries and variables naming and behavior questions

    Hello,

    I'd like to confirm the expected behavior of private DataSeries or public variables with the same name.

    Background to my question is the following: I've developped several strategies (some of which I want to convert to indicators, and possibly run at the same time) which identical routines.
    A. Public Data(or Bool, or Int) Series - For example, an IntSeries storing a condition like "# bars since signal was given", which itself calls a "SignalSeries". Both have the same name across all strategies, but are private.

    B. Public variables: in a few instances, I may have given the same name to public variables - example, two strategies could have a public double "MACDMin" (but, depending on the strategy, not the same value!). Evidently, all have common variable names for offsets like entry price, stop, target...

    1. What happenswhen running the strategies concurrently on the strategy tab on the same instrument, same timeframe - is there a chance strategy A could (erroneously for my purposes) access for example the DataSeries "number of bars since a signal was given" for strategy B?
    2. Same question for public doubles
    3. Is the behavior to be expected/answer to 1 & 2 different if running strategies from a chart?
    4. Finally, if I convert these into indicators, and run concurrently the indicator and corresponding strategy from the same chart, could one mistakenly read info from the other? (this last question should be less of a problem since the values would in theory be identical, but there may be cases I haven't thought of where this could be a problem).

    I looked through the forum could not find a thread explicity answering these exact questions. My understanding is that it is all contained within the strategy/indicator, and there is no way one can access data from another, even with the same name, unless explicitly referenced, but I would like to confirm.

    Also, does this "same naming" consume more resources for NT? Would unique names (say: MACDMinA in strategy A, MACDMinB in strategy B etc.) be more efficient?

    Thank you in advance!

    #2
    farang, strategies generally would not cross communicate, they basically run self contained. Public properties and plots from indicators could be accessed though if desired, but this would need to be explicitly coded into your scripts.



    The name you choose should not matters in performance terms.

    Comment


      #3
      Thank you for your answer.
      To make sure I understand your post + attached sample correctly:
      - a strategy (or indicator) would only access the values from an external DataSeries if this has been declared/coded outside of the stratgey (eg as an indicator, as in the sample file, fe. SampleBoolSeries().BullIndicator).
      IF instead the SampleBoolSeries had been declared and coded entirely within the strategy, NT would only access the values of this DataSeries within the strategy, correct?
      Which also means that, if I convert my DataSeries into an indicator, I should take care to give it a different name in the indicator, otherwise NT might access it? Or is using the "private IntSeries" and "= new IntSeries(this);" code snippets (as opposed "Add()") enough to indicate to NT that it should only look within the strategy for the values, and not outside?

      Sorry to insist, I just want to make sure I have this right, otherwise I'd rather rename my DataSeries to make sure there won't be any cross accessing that would mess up the concurrent running of the strategies...

      Comment


        #4
        farang, your understanding is correct - the DataSeries your declare are only relevant / accessible for this specific strategy / indicator instance then, unless you expose them for external access (which would only be applicable to indicators).

        Comment


          #5
          OK, thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, Yesterday, 10:06 AM
          0 responses
          22 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          19 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          14 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          10 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          41 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X