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

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 -

    BertrandNinjaTrader Customer Service

    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.

        BertrandNinjaTrader Customer Service

        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 The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Started by Aviram Y, Today, 05:29 AM
          0 responses
          5 views
          0 likes
          Last Post Aviram Y  
          Started by quantismo, 04-17-2024, 05:13 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          36 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X