• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

cumulative profit

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

    cumulative profit

    hi
    How can I apply this code to stop trading each day when profit is reached and then restart for next day.

    protected override void OnBarUpdate()
    {
    // If the profit on real-time trades is > $1000 stop trading
    if (Performance.RealtimeTrades.TradesPerformance.Curr ency.CumProfit > 1000)
    return;
    }




    thanks
    shane

    #2
    Hi Shane, I would suggest checking into this more complete sample here on the topic raised - http://www.ninjatrader.com/support/f...ead.php?t=4084
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I have rad all of that

      just wondering what time frame it considers.
      Does it reset daily , weekly or perhaps never restarts trading.

      Once the limit is reached and it stops trading, at what point will trading resume ?

      there is no reference to this in any of the documentation

      Comment


        #4
        Hi Shane, this is done on a per session basis. Code wise the reset is done at your OnBarUpdate start with

        if (Bars.FirstBarOfSession)
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks Bertrand !

          I wasnt sure about that.

          Thank you very much for the prompt reply,

          shane

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by rwilliam, Today, 01:54 PM
          0 responses
          1 view
          0 likes
          Last Post rwilliam  
          Started by franco12364, Today, 11:27 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by YevhenShynkarenko, Today, 11:48 AM
          3 responses
          18 views
          0 likes
          Last Post YevhenShynkarenko  
          Started by NinjaTrader_ChrisL, Today, 11:21 AM
          0 responses
          21 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by lunardiplomacy, Today, 08:09 AM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_Kate  
          Working...
          X