Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Local Variables for Permanent Storage of Exported DataSeries

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

    #16
    aviat72,

    C# passes class variables as copy of the variable and structures as a copy of the content. But, you could easily check that. Define a test dataseries, pass it from the hosted indicator to the hosting indicator and try a modification of the dataseries variable in the hosting indicator. Then check if the modification is visible in the hosted indicator.
    In C/C++ I would simply check the address value of the concerning variable, but I don't know how to do that in C#.

    An alternative would be to use a method with ref/out-parameters. That approach passes variable-references for sure.

    Regards
    Ralph

    Comment


      #17
      Ralph:

      Thanks for your suggestions. I will either write custom export functions or pass a ref in. The ref solution is not the safest but as long as I know what I am doing.

      Since NT only exposes your own code in to Visual Studio it is not the easiest debugging environment where to figure out which object you are viewing in the debugger. I was working with a fairly complex setup and not a simple dedicated example. I guess some print statements with a unique object identifier would have helped.

      Comment


        #18
        aviat72,

        I think, this issue is quite simple because C# specifies that every class instance is passes by reference (no matter what NT supports), and a dataseries is a class (opposed to a structure) as far as I know.

        Since I am paranoid, I tend to double-check approaches I do apply first time. That was the reason to propose the test with the modification of the passed dataseries.

        Passing variables by Property is an efficient approach.

        Regards
        Ralph

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X