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 BartMan, Today, 09:24 AM
    0 responses
    3 views
    0 likes
    Last Post BartMan
    by BartMan
     
    Started by Lucius. valerius, 03-23-2023, 01:39 AM
    7 responses
    168 views
    0 likes
    Last Post NinjaTrader_Ray  
    Started by QuantKey_Bruce, 03-04-2023, 04:54 PM
    27 responses
    720 views
    0 likes
    Last Post waltFX
    by waltFX
     
    Started by Net_Trader, 03-15-2023, 03:17 PM
    18 responses
    213 views
    0 likes
    Last Post NinjaTrader_Ray  
    Started by smjfamily, 03-24-2023, 04:11 PM
    2 responses
    72 views
    0 likes
    Last Post smjfamily  
    Working...
    X