Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Range of the Session and Max Losses

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

    Range of the Session and Max Losses

    I would appreciate some suggestions on coding two functions:

    1) The range of the current day/session interday (Highest and lowest bar)
    2) Setting up a filter that if a certain amount of losses have been recorded during the session, no trades are entered.

    Does anyone have any ideas on these two please?

    FYI I'm using the Iorder system and use interday - 1-minute data.

    Cheers

    Mark

    #2
    Mark, you could use CurrentDayOHL to get the the current session high and low and then find the range from that. As for limiting losses, there is a reference sample that shows how to "turn off" your strategy once a certain loss is reached for the session - http://www.ninjatrader.com/support/f...ead.php?t=4804.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin - thanks for the link.

      I am using the following code:

      Code:
       if (Performance.AllTrades.TradesPerformance.Currency.CumProfit < -1000)
                      return;
      It is placed at the top of my code and seems to work but there is a problem as when I back test, it stops once the loss limit has been reached on the strategy. So I can't test performance.

      Is there a way of re-setting the TradesPerfomance variable at the start of each new session?

      Many thanks

      Mark

      Comment


        #4
        Hi Mark, you'll need to set up another variable to keep track of the daily profit/loss. We actually have another reference sample that shows exactly how to do this - http://www.ninjatrader.com/support/f...ead.php?t=4084.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X