Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access external strategy

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

    Access external strategy

    Hi

    Suppose I have 10 strategies independent that only go long and 10 independent strategies that only go short. Independent is defined as= strategies that were created separately and have their own .cs files within nt8.

    Now suppose I want to create a new strategy that says:

    If long bool = true
    {activate all 10 long strategies}

    Else if short bool = true
    {activate all 10 short strategies}

    Basically what I'm trying to do is, define a "long" market environment and if the conditions for the "long" market environment are true, it will make my long bool = true, and then I can enter long in all of my independent strategies based on their individual rules of entry and trade management.

    I could copy and paste the "defined" long market condition into each individual strategy but I was thinking this would be better.

    How can I access strategies within a strategy?

    Another question

    Suppose I have 10 strategies that are live and are independent of one another. They all follow different entry and exit rules. However, some of the strategies may have identical entry and exit names. For example "entry1" or "target1" etc. I have not noticed any issues and want to confirm that this shouldn't cause any issues? I don't want nt8 to get confused.

    Thanks
    Last edited by staycool3_a; 12-25-2017, 02:08 AM.

    #2
    Hello,

    Thank you for the post.

    It is not possible to start a strategy from another strategy. The solution would be to unify the logic of all of these strategies into one strategy. Then you could control all trading from booleans. Even if your strategies use different time frames and instruments, NinjaScript will support this.

    https://ninjatrader.com/support/help...nstruments.htm - Multi-Time Frame & Instruments

    For your second question, using the same string will not cause issues. NinjaTrader will associate entries/exits from instruments individually. When entering orders for a multi-instrument script, use the overload that takes a BarsinProgress. The EnterLong() method, for example:

    Code:
    EnterLong([B]int barsInProgressIndex[/B], int quantity, string signalName)
    The strategy position that all of your strategies hold will keep the strategies separate from each other.

    Please see this help guide page on Strategy Position vs. Account Position



    Please let us know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X