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

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 algospoke, Yesterday, 06:40 PM
        2 responses
        23 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        45 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        21 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X