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, 01: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(int barsInProgressIndex, 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

    https://ninjatrader.com/support/help..._account_p.htm

    Please let us know if you have any questions.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tgn55, Today, 09:51 PM
    0 responses
    1 view
    0 likes
    Last Post tgn55
    by tgn55
     
    Started by cxxazssx, Today, 09:45 PM
    0 responses
    1 view
    0 likes
    Last Post cxxazssx  
    Started by southpacific001, 02-26-2021, 09:25 PM
    14 responses
    64 views
    0 likes
    Last Post REI140205  
    Started by punkiy2111, Today, 05:22 PM
    0 responses
    3 views
    0 likes
    Last Post punkiy2111  
    Started by secrettrader, Today, 03:36 PM
    0 responses
    8 views
    0 likes
    Last Post secrettrader  
    Working...
    X