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

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:



        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 RubenCazorla, Today, 09:07 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by i019945nj, 12-14-2023, 06:41 AM
        7 responses
        82 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by timmbbo, 07-05-2023, 10:21 PM
        4 responses
        158 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by tkaboris, Today, 08:01 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Lumbeezl, 01-11-2022, 06:50 PM
        31 responses
        820 views
        1 like
        Last Post NinjaTrader_Adrian  
        Working...
        X