Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily PnL target resetting every day

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

    Daily PnL target resetting every day

    hi,
    I am trying a strategy in Strategy Builder that requires the strategy to exit after reaching a certain PnL. The issue is that when the PnL is reached the strategy stops. So, if I try to run it for a month and the PnL is reached the first day, then the strategy exits and it doesn't run for the rest of he month. Is it possible to set it in such a way that the target is somehow reset after is reached so the strategy continue to run for the entire time selected? My target is to reach the PnL and exit for the day, then reset and run again next day.
    thanks

    #2
    Hello space_trader,

    Below is a link to an example of a daily loss limit in the Strategy Builder.
    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader


    When Misc -> First bar of session is true, this means a new session has started, and this is an appropriate time to reset variables.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Great, thanks. I have another question based on the examples provided.

      I see that you use custom variables for the PnL logic instead of using the build in Realized/Unrealized PnL under Strategy. Instead of that I would like to use the build in one. So, I set the First Bar of Session = True and then in the DO THE FOLLOWING tab I would like to initialize the Realized/Unrealized PnL = 0. Problem is, there is no STRATEGY menu access in the DO THE FOLLOWING tab. Is there any alternative? I don't understand how the script "understands'' the manually setting PnL variable from your example. I mean, how can it assign a variable equally to profit or loss of the transaction? I assume this is the reason there is an already set up variable in the software (Realized/Unrealized PnL).

      In any case, my goal is to set a daily PnL limit that when reached, the position(s) close and trading halts till next day.

      Comment


        #4
        Hello space_trader,

        The example uses series and variables to track the Strategy > Realized PnL so that this value can be reset.

        You can choose to use the Strategy > Realized PnL without tracking this with variables, and the value will reset at midnight.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          hello Chelsea,

          Well, that's the problem. The initialization of PnL should be done in the 2nd panel but there is no access to Strategy. This is what I mean. Is this concept of mine wrong?

          thanks
          Attached Files

          Comment


            #6
            Hello space_trader,

            Using Is first bar of session would be for resetting the variables to 0.

            Variables and series can be set in the Do the following section under Misc.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            87 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            132 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            65 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            118 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X