Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access indicator's public variable value

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

    Access indicator's public variable value

    Hi NT experts,
    There is an indicator LinRegSlopeSFX in the file shareing indicator postion.
    I would like to use its slop value in a strategy. It is declared as a public varibale in LinRegSlopeSFX.
    Any way to do that?
    Regards,



    #2
    You would either need to make it a plot so it can be accessed (aka MyIndicator.MyIndicatorPlotValue) or you can also expose internal calcs with the concept shown in this sample -

    Comment


      #3
      Exposing Strategy variables to Indicators

      Hi Bertrand
      I am trying to do the opposite (I think thats what you would call it)

      My strategy takes 1 position at a time, long or short --- and checks the current state using Position.Quantity

      When I have an open position, I would like my indicator to stop printing messages to the output window

      something like:
      if (Position.Quantity > 0)
      do nothing
      else
      print a bunch of stuff to the output window


      I know I cannot uses Open.Position from the indicator -- but I'm thinking I can pass a value from the strategy back to the indicator

      is this possible?
      thanks

      Comment


        #4
        Unfortunately this is not supported, as strategies do not allow cross communication. I think you could achieve what you want by reading / writing values from / to text files.

        Comment


          #5
          Thanks Bertrand
          I will go that route, I'm new to C# so taking it one step at a time

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kinfxhk, 07-14-2026, 09:39 AM
          0 responses
          127 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 07-13-2026, 10:18 AM
          0 responses
          105 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 07-13-2026, 09:50 AM
          0 responses
          85 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 07-13-2026, 07:21 AM
          0 responses
          105 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 07-11-2026, 02:11 AM
          0 responses
          86 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X