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

Daily Loss Limit for Multiple Orders

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

    Daily Loss Limit for Multiple Orders

    Hi there!
    I have a issue with a daily loss limit for MULTIPLE ORDERS
    Lets say by default it is $275.

    private int lossLimit = 275;

    I use IOrder Array for multiple orders.

    private IOrder[] entryOrders = new IOrder[4];

    I have this example from Ninja Trader Support. The program works very well. It stops whenever I have my daily loss of 275.

    However, if I add a CANCEL ORDER method to the program then IT DOESN’T WORK AT ALL. It continues to run the strategy when my daily stop loss hit. Simply saying it doesn't stop.

    if (entryOrders[1] != null && CurrentBar >= barNumbOfShorOrder1 + 1)
    { CancelOrder(entryOrders[1]);
    entryOrders[1] = null;}

    I back tested on 11/02/2015 it supposed to stop at 4:30 am because of my daily loss hit and no more trading till the end of the session. However it continues to run.

    Daily Loss Limit for Multiple orders are very important to me because this is a RISK MANAGEMENT of my strategy

    Do you how to fix this strategy?


    STRATEGY FILE INCLUDED

    Thanks,
    Serge
    Attached Files
    Last edited by olres7; 11-16-2015, 09:50 AM.

    #2
    Hello Serge,

    Thank you for your inquiry.

    Can you please provide an instance when your profit loss is less than or equal to -LossLimit and your exit short order is ignored?

    What exact parameters are you using in your backtest that produces this behavior so I can replicate on my end? What instrument is this on?
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      I already fixed it

      Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by helpwanted, Today, 03:06 AM
      1 response
      10 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      7 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      385 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X