Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Program to Stop Trading for the Day.

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

    Program to Stop Trading for the Day.

    Hi

    How do I program Ninja to stop trading for the day after a certain PnL is reached ?
    It could be profit or loss.

    Let's say I want Ninja to stop trading for the day after reaching $500 profit.

    Also, if I hit 400$ loss (or certain % of my daily loss limit) I want ninja to stop trading for the day.

    Please inform how to do this.

    #2
    Hello Karthink007,

    Thank you for your note.

    You would want to use TradePerformance for the strategy to calculate how well the strategy is doing in terms of Loss or Profit.

    Below are two reference samples that you can use for this setup.
    The first is on how to use the performance for money management -
    http://www.ninjatrader.com/support/f...ead.php?t=4084

    The second is resetting your values at each new session -
    http://www.ninjatrader.com/support/f...ad.php?t=19182

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cal! worked well!

      Comment


        #4
        Hi Cal. The code seems to be working, but is there any other simple way to achieve the same result ?

        Say..

        I want to stop trading after reaching 400$ loss incurred due to either 1 or multiple trades on a particular day. &

        Stop trades after reaching $500 daily profit goal.

        The logic in your example is confusing to me. Please tell if there is any other way to achieve the same result. I came across Disable() in the help guide, but not able to implement it with success.

        Comment


          #5
          Hello karthik007,

          Thank you for your response.

          You would still need to use the Performance values used in the example from Cal. If you just wish to disable the strategy and you will manually enable the strategy on the next session your could use Disable().

          For example:
          if(Performance.RealtimeTrades.TradesPerformance.Cu rrency.CumProfit <= myValue)
          Disable();

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          64 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X