Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

take a daily profit automatically

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

    take a daily profit automatically

    hello, is it possible to take a daily profit by determining the amount? I searched on strategy building software but I couldn't find a session output command or daily pnl total. What do you advise? Thank you

    #2
    Hello 270027,

    Yes, this is possible.

    Below is a link to an example that is a daily loss limit, but the same concept could be used for a daily profit limit.
    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
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello and thank you very much.
      I tried all three.There is only one that can be made changes with the strategy builder . Would you be kind enough to make the other two accessible with the strategy builder? compared to the other they stop in the candle and the one accessible is at the end of the candle and when working on candles of 5 minutes it can be long and far exceed the limit.
      Thanks again

      Comment


        #4
        Hello 270027,

        Unfortunately, no. Only scripts created with the Strategy Builder that have not been unlocked can be opened in the Strategy Builder.

        The custom logic in these scripts means they cannot be created with the Strategy Builder.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello 270027,

          Unfortunately, no. Only scripts created with the Strategy Builder that have not been unlocked can be opened in the Strategy Builder.

          The custom logic in these scripts means they cannot be created with the Strategy Builder.
          hello, could you modify for this it stops in the current candle please? Thank you

          Comment


            #6
            Hello 270027,

            If the strategy is running with Calculate.OnPriceChange, it would exit and stop taking new entries intra-bar.

            In historical, TickReplay and intra-bar granularity would be necessary.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello 270027,

              Yes, this is possible.

              Below is a link to an example that is a daily loss limit, but the same concept could be used for a daily profit limit.
              https://ninjatrader.com/support/foru...ples#post93881
              Hello, I tried to put the profit taking in your example which seemed easy to me. I put in attached file the modified reference file, can you tell me what is wrong? Thank you
              Attached Files
              Last edited by 270027; 12-25-2021, 03:54 AM.

              Comment


                #8
                Hello 270027,

                With:
                (DailyPNL > DailyLoss)
                && (DailyPNL < DailyTP)

                You are trying to trigger an action when the DailyPNL is greater than the DailyLoss and also less than the DailyTP as well correct?

                Print the time, the DailyPNL, the DailyLoss, and the DailyTP to the output window. Include the output saved to a text file with your reply.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello 270027,

                  With:
                  (DailyPNL > DailyLoss)
                  && (DailyPNL < DailyTP)

                  You are trying to trigger an action when the DailyPNL is greater than the DailyLoss and also less than the DailyTP as well correct?

                  Print the time, the DailyPNL, the DailyLoss, and the DailyTP to the output window. Include the output saved to a text file with your reply.
                  https://ninjatrader.com/support/foru...121#post791121
                  hello,
                  can we print with the strategy analyzer? when I do, the information scrolls through the window of the ninja script and fades immediately and I don't have time to save it in text format. Is there a way to get it back?
                  Thank you for your help.

                  Comment


                    #10
                    Hello 270027,

                    Yes, you can call Print() from indicators and strategies at any time. You can also call Code.Output.Process() in addons at any time. Think of this as Console.WriteLine() but for NinjaScripts.

                    You can right-click the output window and select save as to save the output to a text file. Click upload attachments to attach a text file to your post.


                    You could copy and paste the text back in your post instead, but this makes for long posts that obscure your actual messages. The choice is up to you.

                    The output is how to diagnose issues. Without looking at how the code is processing, there isn't the ability to understand why the mechanism is working as it is.

                    My advice would be to take the time to learn C#, how to get output, and how to use the NinjaTrader Platform before tackling any complex project. C# is a big world with a lot of possibilities and a lot to learn. Don't rush through things and actually set aside some time to learn about what you are doing. In the long run, what you create will have a solid foundation.
                    Last edited by NinjaTrader_ChelseaB; 12-28-2021, 01:05 PM.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello 270027,

                      Yes, you can call Print() from indicators and strategies at any time. You can also call Code.Output.Process() in addons at any time. Think of this as Console.WriteLine() but for NinjaScripts.

                      As noted in the forum post on using prints to understand behavior linked in post# , you can right-click the output window and select save as to save the output to a text file. Click upload attachments to attach a text file to your post.

                      You could copy and paste the text back in your post instead, but this makes for long posts that obscure your actual messages. The choice is up to you.

                      The output is how to diagnose issues. Without looking at how the code is processing, there isn't the ability to understand why the mechanism is working as it is.

                      My advice would be to take the time to learn C#, how to get output, and how to use the NinjaTrader Platform before tackling any complex project. C# is a big world with a lot of possibilities and a lot to learn. Don't rush through things and actually set aside some time to learn about what you are doing. In the long run, what you create will have a solid foundation.
                      hello, I think I made myself misunderstood. since the strategy analysis tool can we record? I put you a link attached what happens when I press the run



                      Thank's

                      Comment


                        #12
                        Hello 270027,

                        Are you calling ClearOuputWindow() in any of your custom scripts?

                        I am not able to reproduce on my end.
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by NullPointStrategies, Yesterday, 05:17 AM
                        0 responses
                        64 views
                        0 likes
                        Last Post NullPointStrategies  
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        139 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        75 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        45 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        50 views
                        0 likes
                        Last Post TheRealMorford  
                        Working...
                        X