Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to have one strategy start another strategy

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

    Need to have one strategy start another strategy

    HI,
    I need to do something like the following:
    When my strategy A starts, it immediately enters a LONG position.
    Once the LONG position is entered, the price is retrieved for the LONG position and then this strategy A loads strategy B which gets passed the fill price of the LONG position.
    Strategy B then opens a SHORT position based upon the price of the LONG position. It may then load stratgy C, passing the filled price of the SHORT position.

    Can someone tell me, how do I pass the entry prices between strategies,
    how do I kick-off a strategy from within another strategy, and if it is possible to close a strategy form within another strategy?

    Sorry for dumb questions. I am a newbie!

    #2
    >> how do I kick-off a strategy from within another strategy, and if it is possible to close a strategy form within another strategy?
    Not possible. However, you could try to code your logic in one strategy instead of two.

    Note:
    - a strategy may have multiple entries/exits over time. A strategy is not (!) terminated after the first trade is closed.
    - you may even "tag" entries and have multiple entries active the same time. Please check out the tutorials: http://www.ninjatrader-support.com/H...verview39.html

    Comment


      #3
      The problem I am trying to solve is that I want to have long and short positions in the same instrument simultaneously. The only way to do this is to have separate strategies for each request so that one does not cancel the other.

      But, I absolutely need this event-driven, so that the second strategy only submits it's order once the first one is filled.

      I jsut figured out how to do this. I will have to use static var's that all strategies can access. I will start up all strategies at the beginning.
      then when strategy A gets it's order filled, it sets a flag that stratgy B can poll for. At this point, strategy B can submit it
      s order.

      Does this sound like the only way I can do this??

      Comment


        #4
        I see.

        >> I will have to use static var's that all strategies can access
        Yes, you could try that.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        562 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X