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 elirion, Yesterday, 09:32 PM
        0 responses
        6 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by cre8able, Yesterday, 09:15 PM
        1 response
        8 views
        0 likes
        Last Post bltdavid  
        Started by cummish, Yesterday, 08:43 PM
        0 responses
        14 views
        0 likes
        Last Post cummish
        by cummish
         
        Started by Option Whisperer, Yesterday, 07:58 PM
        4 responses
        21 views
        0 likes
        Last Post Option Whisperer  
        Started by ETFVoyageur, 05-07-2024, 07:05 PM
        13 responses
        87 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X