Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enetering Multiple Orders with Single Condition

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

    Enetering Multiple Orders with Single Condition

    I am experimenting with entering and taking off contracts at different profit targets. Using the wizard I created the entry conditions outlined below:

    Code:
           protected override void OnBarUpdate()
            {
                // Condition set 1
                if (CrossAbove(Close, SMA(Median, Period1), 1))
                {
                    EnterLong(DefaultQuantity, "Long1");
                    EnterLong(DefaultQuantity, "Long2");
                    EnterLong(DefaultQuantity, "Long3");
                }
    
                // Condition set 2
                if (CrossBelow(Close, SMA(Median, Period1), 1))
                {
                    EnterShort(DefaultQuantity, "Short1");
                    EnterShort(DefaultQuantity, "Short2");
                    EnterShort(DefaultQuantity, "Short3");
                }
    The problem is, I am only getting a single entry when I have the MA cross, when I should have 3 entries with different labels. Am I doing something wrong?
    DaveN

    #2
    daven,

    When you run your strategy you will have an option called Entries Per Direction. You can bump that up to 3 if you want 3 longs and 3 shorts simultaneously.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X