Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

recover variable from indicator to strategy

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

    recover variable from indicator to strategy

    Hi,
    i have buttons on an indicator. By clicking on it, i set a flag (ex : flag="A10").
    How can i use this value in my stategy ?
    I do not find help about this.

    Thanks for your answers.

    #2
    Hello fredericlebre,

    Thank you for your post.

    Strategies are able to use variables that are exposed by an indicator. If you would like to have a variable accessible from an indicator, you will need to make a public variable, like the properties in the SampleBoolSeries example script below, and access the private variable from there.

    Please see the reference sample source code for the SampleBoolSeries indicator which demonstrates this for the Series named BullIndication and BearIndication. These variables are declared publicly alongside the input properties except with [Browsable(false)] and [XmlIgnore] to prevent the public variable from listing as a parameter.

    SampleBoolSeries - https://ninjatrader.com/support/forum/forum/ninjascript-educational-resources/reference-samples/5161-indicator-exposing-indicator-values-that-are-not-plots?t=4991

    Let us know if we may further assist.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    50 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    69 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    36 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    97 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    60 views
    0 likes
    Last Post PaulMohn  
    Working...
    X