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 DJ888, 04-16-2024, 06:09 PM
                4 responses
                12 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by terofs, Today, 04:18 PM
                0 responses
                11 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by nandhumca, Today, 03:41 PM
                0 responses
                7 views
                0 likes
                Last Post nandhumca  
                Started by The_Sec, Today, 03:37 PM
                0 responses
                3 views
                0 likes
                Last Post The_Sec
                by The_Sec
                 
                Started by GwFutures1988, Today, 02:48 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Working...
                X