Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily profit and loss in strategy builder

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

    Daily profit and loss in strategy builder

    I need help in figuring out how to make a strategy in strategy builder stop making trades after a daily loss or profit target is hit. I have downloaded the “Daily Loss Limit Builder Example” that is mentioned in other posts, however it only seems to track the daily loss and not the daily profit. In other words, as long at the daily loss hasn’t been hit it will keep trading regardless of the cumulative profit. I just want it to stop making trades at $500 daily profit or loss. I have figured out how to use the “realized PNL” feature in strategy builder, however you have to back test one day at time with that method. Any wisdom you can offer would be appreciated!

    #2
    Hello rmhollon,

    The example is meant to show how the strategy builder can be used for this kind of logic.

    I encourage you to use the DailyLossLimitBuilderExample as a learning tool and create your script that also adds inputs for a DailyProfit and add conditions to the entry conditions sets that compare the DailyPnL to be less than the DailyProfit to allow an entry.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, please provide that list of educational and consulting services. I have tried 8 ways from Sunday to make the strategy work on Ninjatrader back testing and I just can't get it to replicate what I am coming up with on Tradingview, not even close.

      Comment


        #4
        Hello rmhollon,

        You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!
        Programming Services - https://ninjatraderecosystem.com/sea...mming-services
        Educators - https://ninjatraderecosystem.com/sea...ures=education

        You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.

        This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

        Please let me know if you have any questions, or if I can provide any further assistance.​
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you for those links and I will check them out. I do have a question about the strategy I have developed. I have a simple strategy that has a daily PNL of 500/-500 which I have successfully built through strategy builder. The only way to backtest in Ninjatrader is one day at a time with this method. I have also used the 'Daily PNL Example' found on this forum for a continuous backtest. In both cases, the strategy works but will continue to make one more trade on some days when the profit limit has been reached and some days it works as intended. What is the solution to make the strategy stop once it reaches 500 profit or 500 loss every day?

          Comment


            #6
            Hello rmhollon,

            You could consider adding the Strategy > Unrealized PnL to the StrategyTotalPNL series. (Set it to itself and in the offset select Strategy > Unrealized PNL).

            Note, in historical this will only update when the bar closes.

            If you want to have an immediate exit in historical, the script would need to be unlocked and coded by hand. See the DailyLossLimitExample_NT8 (unlocked) example.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            50 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            126 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            69 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            42 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X