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

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 trilliantrader, Today, 08:16 AM
          2 responses
          6 views
          0 likes
          Last Post trilliantrader  
          Started by samish18, Today, 08:31 AM
          1 response
          1 view
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by Creamers, 09-08-2023, 10:26 AM
          6 responses
          157 views
          0 likes
          Last Post JonyGurt  
          Started by funk10101, Today, 08:14 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by bill2023, Yesterday, 08:51 AM
          3 responses
          22 views
          0 likes
          Last Post bltdavid  
          Working...
          X