Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a Hard stop for a system

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

    Creating a Hard stop for a system

    I need assistance on writing code to create a Hard Stop for my Strategies based on a specific dollar loss.

    Let's say I observed that a $200 loss as the point of no return for a single trade. I observe this simply from looking at the MAE/MFE scatter plot.

    How would you express that in the strategy in Ninjascript?

    Could I go through the wizard build the stop, set that number then copy and paste the code at the bottom of selected strategies and simply recompile?

    Would the implication be that I realize this $200 loss more frequently?

    Thanks.

    #2
    Hello,

    You can access performance data via the Performance object. If you wish to check your cumulative profit for the session, you can check Performance.AllTrades.TradesPerformance.Currency.C umProfit. We have a reference sample that shows exactly what you are looking for, which you can see at the link below:

    http://www.ninjatrader.com/support/f...ead.php?t=4084

    I'm not too clear on your last two questions. Are you referring to just copying the NinjaScript generated code? Where would you be pasting it? Checking and limiting your loss per day should not cause you to reach your maximum loss more frequently, that would depend upon your strategy's performance.
    Last edited by NinjaTrader_DaveI; 05-11-2015, 07:50 AM.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Correct. I make a partial strategy with just the requirement of stopping at a dollar loss.THen copy and paste that code to the strategies I want hard stops. My programming skill is limited.

      Comment


        #4
        Hello Nullid,
        Thanks for the reply.

        Copy and pasting may not give you the results that you are trying to accomplish and may lead to errors. The code will not necessarily fit directly and may need to be adapted before putting into your strategy.

        Are you getting an error after applying these changes? After pasting in the adapted code what is the result you are receiving?
        Alex G.NinjaTrader Customer Service

        Comment


          #5
          I will try it tnight.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          621 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          566 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X