Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Strategy if weekly loss exceeds a certain level

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

    Stop Strategy if weekly loss exceeds a certain level

    Hi NT Support,

    is there a script i can add to my strategy to make sure it stops trading for the week if losses exceed a certain level (lets say 1000$)? Trading should resume on the following Monday.

    Thanks, John

    #2
    Hello sburtt,

    You may view the following reference sample that demonstrates how to use Trade Performance to help manage your strategy.


    If you would like to reset this every Monday then you may use the DateTime object to check for this. Here is a reference sample that goes over how the DateTime object that you may also view.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JC View Post
      Hello sburtt,

      You may view the following reference sample that demonstrates how to use Trade Performance to help manage your strategy.
      JC, thanks for your reply. I was looking at this SamplePnL and I have a few question.

      1- Given I need this rule in place for real time trading, I would be using "RealtimeTrades", rather than "AllTrades", however how can could I then back test the strategy? would I need to keep "AllTrades" for backtesting purpose?

      2- I notice this code is based on Bars.FirstBarOfSession, does this mean it resets every day, I run anintraday strategy on Forex using a SessionTemplate = Default 24/7, how could I adapt the code to make sure the PnL check is weekly rather than daily?

      3 - Finally is this PnL count in $? what if I am using the strategy on USDJPY and my PnL is in JPY? would this adapt to USD or do I need to use a JPY value?

      Thanks for your help
      Last edited by sburtt; 05-19-2013, 07:07 AM.

      Comment


        #4
        Hello sburtt,

        Thank you for your response.
        Originally posted by sburtt View Post
        1- Given I need this rule in place for real time trading, I would be using "RealtimeTrades", rather than "AllTrades", however how can could I then back test the strategy? would I need to keep "AllTrades" for backtesting purpose?
        To keep track of the previous trade you would need AllTrades, for the current position's PnL you would need to use GetProfitLoss(): http://www.ninjatrader.com/support/h...profitloss.htm
        Originally posted by sburtt View Post
        2- I notice this code is based on Bars.FirstBarOfSession, does this mean it resets every day, I run an intraday strategy on Forex using a SessionTemplate = Default 24/7, how could I adapt the code to make sure the PnL check is weekly rather than daily?
        So you would only want the check done once a week rather than on each day? You can use the DateTime structure and create a condition to only check the PnL for AllTrades once a week (on your desired day of the week): http://www.ninjatrader.com/support/f...ad.php?t=19292
        Originally posted by sburtt View Post
        3 - Finally is this PnL count in $? what if I am using the strategy on USDJPY and my PnL is in JPY? would this adapt to USD or do I need to use a JPY value?
        This would adapt to USD.

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        670 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X