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

Can't Create Multiple Orders in Strategy

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

    Can't Create Multiple Orders in Strategy

    I have a strategy that creates 3 orders when there is a trade signal. In SetDefaults, I have set UniqueEntries and I use a unique identifier in the EnterLong() functions. Code is below.

    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.UniqueEntries;

    EnterLong("MA3L_A");
    SetStopLoss("MA3L_A", CalculationMode.Ticks, dPriorBarSize*.7, false);
    SetProfitTarget("MA3L_A", CalculationMode.Ticks, dPriorBarSize*.7);

    EnterLong("MA3L_B");
    SetStopLoss("MA3L_B", CalculationMode.Ticks, dPriorBarSize*1.2, false);
    SetProfitTarget("MA3L_B", CalculationMode.Ticks, dPriorBarSize*1.2);

    I am only getting a single order for MAS3L_A. The orders for MA3L_B never get executed.

    Is there something else I have to set? My strategy will have 3 different orders per signal.

    Thanks.

    #2
    Never mind, I figured it out. I'm running the strategy in the Strategy Analyzer and there's a separate property to set unique entries. I guess it ignores the code when testing in this mode. :-(

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Barry Milan, Yesterday, 10:35 PM
    5 responses
    16 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by DanielSanMartin, Yesterday, 02:37 PM
    2 responses
    13 views
    0 likes
    Last Post DanielSanMartin  
    Started by DJ888, 04-16-2024, 06:09 PM
    4 responses
    12 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    11 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    8 views
    0 likes
    Last Post nandhumca  
    Working...
    X