Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing An Indicator Using A Strategy

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

    Accessing An Indicator Using A Strategy

    Hi,

    I'm not quite sure about the best way to solve this problem. I have a real-time only indicator (i.e., it does not reference historical data) that I plot on a chart. I also have an existing strategy on this same chart.

    I would like the strategy to be able to read the indicator's values WITHOUT calling a separate instance of the indicator itself because I plan to turn the strategy on and off several times per day from within the Control Center and since the indicator will be a real-time only indicator a seperate instance of the indicator will be different from the actual instance on the chart.

    In other words, I do not want to call a separate and different instance of the indicator on the chart. I want the strategy to look at the same instance of the indicator that is on the chart BUT without refreshing the indicator since I will be turning the strategy on and off several times.

    I hope that makes any sense. Any help will be greatly appreciated.

    #2
    Hello maltese,

    Since, you would have to have the indicator placed inside strategy to have the same instance of the indicator, you may want to have the strategy write to a file and then the Strategy read that files to be able to keep the real-time value and Indicator on the chart.

    Here is a link to a reference sample that you may view that writes and reads to a file.


    Let us know if this will work for you.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JC View Post
      Hello maltese,

      Since, you would have to have the indicator placed inside strategy to have the same instance of the indicator, you may want to have the strategy write to a file and then the Strategy read that files to be able to keep the real-time value and Indicator on the chart.

      Here is a link to a reference sample that you may view that writes and reads to a file.


      Let us know if this will work for you.
      That's what I kinda figured.

      Do you know how I can capture the value of an indicator at Bar Close only instead of each incoming tick when CalculateOnBarClose is set to false.

      Comment


        #4
        Hello maltese,

        Yes, you may use the "FirstTickOfBar" as a condition to only write a value only once when a new bar is formed.



        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        344 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        557 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X