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

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 algospoke, 04-17-2024, 06:40 PM
        6 responses
        48 views
        0 likes
        Last Post algospoke  
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        19 views
        0 likes
        Last Post traderqz  
        Working...
        X