Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 funk10101, Today, 09:43 PM
            0 responses
            2 views
            0 likes
            Last Post funk10101  
            Started by pkefal, 04-11-2024, 07:39 AM
            11 responses
            36 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Yesterday, 08:51 AM
            8 responses
            44 views
            0 likes
            Last Post bill2023  
            Started by yertle, Today, 08:38 AM
            6 responses
            25 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            24 views
            0 likes
            Last Post algospoke  
            Working...
            X