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

Split Order: Scalp and Runner

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

    Split Order: Scalp and Runner

    Hey!

    I'm trying to emulate a split order as I can set up an an ATM strategy. Can you let me know what's wrong with this code? It seems to only place one order when triggered.

    Thanks



    Code:
    if ((Position.MarketPosition == MarketPosition.Flat)
    && (Conditions == true))
    
    {
    
    SetProfitTarget(@"scalp", CalculationMode.Ticks, 7);
    SetStopLoss(@"scalp", CalculationMode.Ticks, 18, false);
    EnterShortStopMarket(currentStopLong - (TickSize * 7), @"scalp");
    
    SetProfitTarget(@"runner", CalculationMode.Ticks, 28);
    SetStopLoss(@"runner", CalculationMode.Ticks, 24, false);
    EnterShortStopMarket(currentStopLong - (TickSize * 8), @"runner");
    
    }
    Last edited by coopgrafik; 07-07-2021, 06:02 PM.

    #2
    Hello coopgrafik,

    Thanks for your post.

    I suspect that your entries per direction are set to a value of 1 with your entry handling set to "AllEntries", these are the strategy default settings and would allow for 1 entry only, per direction.

    As you are using signal names, all you need to do is set the "Entry Handling to "UniquesEntries". (The signal names differentiate the entries making them unique so both entries would be made).

    You can set this in the strategy itself or you can set this when you apply the strategy in the strategy parameters.

    Reference: https://ninjatrader.com/support/help...ryhandling.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul. That worked like a charm!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X