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

Stop Trading after certain amount of losses

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

    Stop Trading after certain amount of losses

    Is there a way that trading can stop for the remainder of a month if a certain amount of losses in that month is attained? I cannot find any commands regarding months. Thanks

    #2
    Hello Chris001,

    Thank you for your post.

    You would need to track performance and then use Time[0].Month to track the month.

    For information on Performance in NinjaScript please visit the following link: http://www.ninjatrader.com/support/h...erformance.htm

    For information on Time please visit the following link: http://www.ninjatrader.com/support/h...s/nt7/time.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thank you. I think I need a little more help. I think I will need to know how to track the first day of the month, how can that be done?

      Comment


        #4
        I just had an idea to try out tomorrow. Hopefully it's on the right track

        Code:
        if (Bars.FirstOfSession
        && Time[0].Month != Time[1].Month)
        {do stuff}

        Comment


          #5
          Looks good Chris001!
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by nicthe, Today, 07:38 AM
          0 responses
          6 views
          0 likes
          Last Post nicthe
          by nicthe
           
          Started by burtoninlondon, 04-28-2024, 12:38 AM
          3 responses
          34 views
          0 likes
          Last Post burtoninlondon  
          Started by burtoninlondon, 05-01-2024, 10:13 AM
          2 responses
          24 views
          0 likes
          Last Post burtoninlondon  
          Started by LillyMarv, Today, 06:47 AM
          0 responses
          4 views
          0 likes
          Last Post LillyMarv  
          Started by Salahinho99, Today, 04:13 AM
          0 responses
          16 views
          0 likes
          Last Post Salahinho99  
          Working...
          X