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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          673 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          379 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          111 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          577 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          582 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X