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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X