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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        23 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        20 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        10 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        41 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X