Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies Communication

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

    Strategies Communication

    Hi,

    I'm thinking of developing a strategy that communicates to other already running strategies in the Strategies tab and based on that makes trade decisions.
    Can the running strategies in the Strategies tab get a reference (talk to) each other?
    What is property StrategyBase.Strategies for? It seems to be empty always in my tests.

    Thanks.

    #2
    Hello,

    Unfortunately you cannot have strategies talk to eachother in this manor. What you could do is create an indicator that returned the values that would be obtained from another strategy and then pass those to the strategy that needed them.

    For our helpguide on passing values from an indicator to a strategy: http://www.ninjatrader.com/support/h...indicators.htm

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_Lance,

      Do you mean to develop an indicator that has a business logic of another strategy? Can you explain how an indicator can obtain values from another strategy?
      I wanted to access a running live strategy to check its performance while it's running etc.
      Last edited by corrado; 03-20-2013, 04:24 PM.

      Comment


        #4
        You would need to expose values from the strategy that can be read by the indicator. The indicator could then pass this information to another strategy.

        We do not have an exact example to show you how to complete, however this sample on Exposing values that are not plots should help:

        MatthewNinjaTrader Product Management

        Comment


          #5
          Got it! Thank you.

          Comment


            #6
            Corrado,

            The simplest way for 2 strategies to communicate is by using static variable.

            For example, define in UserDefinedMethods.cs:
            partial class Strategy
            {
            protected static string myMessage ;
            }

            I would suggest creating a bit more sophisticated message structure though that would include sender, time sent, etc.

            Comment


              #7
              michaelsh, Good idea!. Thank you.

              Comment


                #8
                Originally posted by michaelsh View Post
                Corrado,

                The simplest way for 2 strategies to communicate is by using static variable.

                For example, define in UserDefinedMethods.cs:
                partial class Strategy
                {
                protected static string myMessage ;
                }

                I would suggest creating a bit more sophisticated message structure though that would include sender, time sent, etc.
                Make that a List<> of structs, each struct containing the details of the message, sender, time, etc.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by RaddiFX, Today, 09:55 PM
                0 responses
                1 view
                0 likes
                Last Post RaddiFX
                by RaddiFX
                 
                Started by Trader146, 03-29-2024, 01:22 PM
                4 responses
                24 views
                0 likes
                Last Post Trader146  
                Started by elirion, Today, 09:48 PM
                0 responses
                2 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by set2win, 08-04-2021, 09:23 AM
                39 responses
                1,001 views
                0 likes
                Last Post WaleeTheRobot  
                Started by md4866, Today, 08:15 PM
                0 responses
                8 views
                0 likes
                Last Post md4866
                by md4866
                 
                Working...
                X