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

Trading once per session

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

    Trading once per session

    Using the strategy wizard, how would I set a condition where only a defined number of entries per session were taken?

    I´d quite like to be able to define the number per session in the backtest preferences.

    #2
    Hi ScottieDog,

    Thanks for your post.

    To accomplish the goal of trading once per session you could set a user variable when a trade is submitted that would then prevent further orders and then reset that variable on the session break. The session break is a bool that is available in the condition builder. To set a user variable, here is a reference/example: http://ninjatrader.com/support/forum/showthread.php?t=15417

    If you want to have more than one trade per session then you would need to unlock your code and then in Ninjascript add a condition and variable tied to the number of trades you wish to limit to and either decrement or increment a counter. Once unlocked you would be unable to use the strategy wizard directly with that code.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hi ScottieDog,

      Thanks for your post.

      To accomplish the goal of trading once per session you could set a user variable when a trade is submitted that would then prevent further orders and then reset that variable on the session break. The session break is a bool that is available in the condition builder.
      Could you expand a little on the method quoted? I don't really understand (nooooob, sorry).

      Comment


        #4
        Hello ScottieDog,

        Thanks for your reply.

        Please visit the link previously provided, download the example strategy and review what is happening in that strategy as it is an example of using variables in the strategy wizard.

        In summary you would check to see if the sessionbreak is true and if so then the action would be to set a variable to a specific value. In your conditions to enter a trade you would check to see that the variable is set to the value set by the session break and it is matches and your other entry conditions are true for the action you then enter the trade and now set the same user variable to some other value so no further trades would occur until the session break sets it back to the value.

        To further assist I've created a short video that goes beginning to end on the process: http://screencast.com/t/R58UvzxYig
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank-you very much. Comprehensive response. I get it now.

          Comment


            #6
            will that video remain active, or should i download it?

            Comment


              #7
              Hello ScottieDog,

              Thanks for your replies and glad we could help.

              I believe the video will remain for quite some time.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                I implemented that code and it is working as planned. Excellent. Thank-you.

                Comment


                  #9
                  Originally posted by NinjaTrader_PaulH View Post
                  Hello ScottieDog,

                  Thanks for your replies and glad we could help.

                  I believe the video will remain for quite some time.
                  Hi Paul,

                  Could you please share the video again? Thanks a lot!

                  EDIT:
                  I'm getting the following from the link shared in post #2 above:

                  Invalid Page URL. If this is an error and the page should exist, please contact the system administrator and tell them how you got this message.

                  Do you have another access? Thanks a lot!
                  Last edited by Cormick; 06-03-2021, 04:05 PM.

                  Comment


                    #10
                    Hello Cormick,

                    Thanks for your post on this thread from 2016.

                    This thread is in the NinjaTrader 7 forums and would not directly relate to NinjaTrader8 Strategy Builder

                    The video service I was using 5 years ago was based on Flash which has since been obsoleted and is simply no longer available.

                    The link in post #2 is irrelevant if you are not using NinjaTrader7 as it was specific to the Strategy Wizard and simply showed how to set a user variable which again is different in the NinjaTrader7 strategy wizard than the NinjaTrader8 Strategy Builder.

                    If you have a NinjaTrader8 question, please create a new topic in the appropriate NinjaTrader8 forum so we can keep the forums from being confusing.

                    Thanks for your understanding.
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Paul,

                      Thanks for the NT7 observations.

                      Thanks for the NT8 forum redirection. I'll post now.

                      Could you please also make the video for NT7? I'll use NT7 with a 2nd account.

                      Thank you.

                      Note on Videos archiving:

                      Comment


                        #12
                        Hello Cormick,

                        Thanks for your reply.

                        Can you clarify what specific issue you are having with the NinjaTrader7 strategy wizard?


                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi Paul,

                          Thank you for the reply.

                          In specific:

                          user variable creation.

                          session break use.


                          Access to the post content (from post #2 above):

                          Access to new NT7 video.

                          Thank you.

                          EDIT:

                          Also, access to the strategy example mentioned in post #4 above:
                          Last edited by Cormick; 06-04-2021, 11:28 AM.

                          Comment


                            #14
                            Hello Cormick,

                            Thanks for your reply.

                            Please see these references for learning NinjaTrader7 Strategy Wizard:

                            https://www.youtube.com/watch?v=FmBi...D7105&index=10 User variables are reviewed about the 30:20 mark

                            https://www.youtube.com/watch?v=vt0s...A140D7&index=6 Even though you are not asking about alerts, this shows some important functionality of the wizard

                            https://ninjatrader.com/support/help...egy_wizard.htm Help guide for the wizard.

                            NinjaTrader7 help guide also provides a strategy wizard tutorial: https://ninjatrader.com/support/help...strategies.htm

                            The post content is no longer available. The forum software was updated a few years ago and some links are simply nonfunctional.

                            The video from post 4 is not available as has been previous mentioned.

                            In the strategy wizard, to create a once per session order, you would:

                            1) In the first set create a condition of Misc>Session Break, ==, Misc>true
                            2) In the first set create an action of Misc>Set user defined variable, and set the value of Variable0 to 1
                            3) In set 2 you would have your entry conditions and add a check that User Variables> Variable 0 == Misc>Numeric Value set to 1
                            4) In the action set 2, you would add the action to set Variable0 to 0.

                            Using the User variables as a 1 or 0 accomplishes the same thing as in Ninjatrader8 strategy builder when using bool variables. In this case 0 = false and 1 = true.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Paul,

                              Thank you for your reply.

                              Ok. Thanks. I'll try it once I get the NT8 one sorted.

                              Perhaps systematically archiving all the forum once a month or every quarter would prevent any of the forum software update problem to ever reoccur.
                              The knowledge base is worth it.

                              As suggested here:
                              Today, 07:09 AM
                              Hello Chelsea,

                              Another idea.

                              Perhaps creating free https://archive.org/ accounts and using costless macro programs (the likes of Pullover macro https://www.macrocreator.com/ etc.) to archive all your videos.

                              And archiving all your posts/ or entire forum:
                              Archive.org Chrome extension v 3.0 Feedback
                              https://github.com/internetarchive/w...e-webextension
                              Saying because the problem is not isolated, and is bound to increase with time as long as it's neglected and not fixed:
                              https://ninjatrader.com/support/foru...03#post1158803

                              Thanks a lot!

                              HTTRACK
                              https://www.httrack.com/
                              ​​​​​​​



                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              31 views
                              0 likes
                              Last Post love2code2trade  
                              Started by cls71, Today, 04:45 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post eDanny
                              by eDanny
                               
                              Started by proptrade13, Today, 11:06 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post proptrade13  
                              Started by kulwinder73, Today, 10:31 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by RookieTrader, Today, 09:37 AM
                              3 responses
                              15 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X