• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to reference a variable from another strategy in a different chart

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

    how to reference a variable from another strategy in a different chart

    Hey,

    I have created a strategy that triggers an Alarm at a specific price level stored in a variable in a linebreak chart.

    How can I access this Price variable instantly with a different strategy in another chart of the same Instrument?

    I need this Price level as a trigger for the other chart to do something.

    Thank you

    #2
    Hello anmu1990,

    Thank you for your post.

    To clarify, what type of script is creating and storing the value in the variable? (Indicator, Strategy, AddOn, etc). Did you create this script as well, or is it a third party script?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      It is a Strategy coded by myself.

      Comment


        #4
        Hello anmu1990,

        Thank you for your reply.

        Two strategies cannot directly "talk" to one another. In general, there is not a specific/reliable way to share data between strategies specifically as strategies are intended on being isolated from everything else. Can you provide more detail on your end goal so that I can try to provide the best solution here? Is this just a single bool value you want the second strategy to read, or are you wanting to pass the current price, or something else? When would the value be set, would this be based on some strategy condition or by your choosing?

        Based on your initial description, it sounds like you would want just a single strategy for this use case. Is there a specific reason you are using two separate scripts here instead of just one script with an added secondary series? As noted there is no means to share data between two strategies that are reliable so my initial suggestion is to combine the logic into a single script.

        Here's a link to our help guide on working with multiple data series in the same strategy:

        https://ninjatrader.com/support/help...nstruments.htm

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chrismcdermut, Today, 01:46 PM
        0 responses
        2 views
        0 likes
        Last Post chrismcdermut  
        Started by dpolyakov, Today, 01:13 PM
        3 responses
        14 views
        0 likes
        Last Post dpolyakov  
        Started by tjendra, Today, 12:15 PM
        3 responses
        9 views
        0 likes
        Last Post tjendra
        by tjendra
         
        Started by lunardiplomacy, Today, 11:46 AM
        4 responses
        16 views
        0 likes
        Last Post lunardiplomacy  
        Started by trdninstyle, Today, 10:38 AM
        2 responses
        17 views
        0 likes
        Last Post trdninstyle  
        Working...
        X