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

One Trade Per Day

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

    One Trade Per Day

    I'm bringing this back up - if a trader wants to enter only one trade a day (session set to market) and has a strategy set up, how can they utilize the Wizard to add this criteria - one trade per session. I see a lot pre v7 posts, and am wondering if there is anything under the Condition Builder - session break that would work? I am still hoping not to have to go into the code, I've been given links and zip files, but I think they are all pre NT v.7

    Thank you!

    #2
    Originally posted by Dia1496 View Post
    I'm bringing this back up - if a trader wants to enter only one trade a day (session set to market) and has a strategy set up, how can they utilize the Wizard to add this criteria - one trade per session. I see a lot pre v7 posts, and am wondering if there is anything under the Condition Builder - session break that would work? I am still hoping not to have to go into the code, I've been given links and zip files, but I think they are all pre NT v.7

    Thank you!
    Did you miss my reply on your other post?

    Comment


      #3
      I did receive the reply and downloaded the files of coding. However, I'm seeing features such as session breaks that I'm thinking can handle this without having to add that code. I'm not sure where to even plug in the code. Some code I've looked at is over 2 years old and certainly older than NT Version 7, other code is pertaining to PnL balance. So I'm looking specifically for a new session break before taking another trade.

      Comment


        #4
        Originally posted by Dia1496 View Post
        I did receive the reply and downloaded the files of coding. However, I'm seeing features such as session breaks that I'm thinking can handle this without having to add that code. I'm not sure where to even plug in the code. Some code I've looked at is over 2 years old and certainly older than NT Version 7, other code is pertaining to PnL balance. So I'm looking specifically for a new session break before taking another trade.
        and with the other set1 and set2, use this for set3.

        does it not work?
        Attached Files

        Comment


          #5
          Hi Sledge, I can put this as the next set, I am not sure how to handle the variable however. So if My criteria for Long is on Set 1, and Short criteria on Set 2, I would put this on Set 3. Do I give the variable a number othre than zero? I'm still getting more than one trade per day.

          Comment


            #6
            Originally posted by Dia1496 View Post
            Hi Sledge, I can put this as the next set, I am not sure how to handle the variable however. So if My criteria for Long is on Set 1, and Short criteria on Set 2, I would put this on Set 3. Do I give the variable a number othre than zero? I'm still getting more than one trade per day.
            I only showed the "long side" for simplicity as the rest would follow from that.

            You'd probably need to mimic set1/2 in set4/5 for short, and have set3 reset variable1 for shorts.

            I don't use the builder, as I'm a coder. This was my 2nd attempt at looking at it in a long time.

            Comment


              #7
              Dia1496, please find attached a simple strategy example from the wizard as courtesy, this would implement what you seek for the long side.
              Attached Files
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Thank you Bertrand, this does return only one trade per day. A question, I noticed if the opening bar contains the signal it will not take the trade until the next instance. This is not the case if the 2nd or beyond bars contain the signal. Is there a reason it is ignoring the first bar of the session?

                Comment


                  #9
                  That could be the case, as the first bar is doing the reset for the tracking variable.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Hi,

                    I'm very noobish at this coding thing..... so after uploading that file do I simply copy and paste the code in that attached file at the bottom of my strategy (after I have unlocked the code for my strategy).

                    Thanks.

                    Comment


                      #11
                      cbc, it would not need to be unlocked for the idea shown in the demo file - it works via user variables and the daily reset at session break that you could capture as condition from the wizard - thus allowing you to execute one trade only, as your variable that keeps track would not allow further to happen once one trade has been done. It would only allow a trade to happen again on the next day, as your tracking variable would be reset then to a value of 0 (Condition set 2).
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Ok

                        Bertrand,

                        Thank heaps for your help. I'm really sorry to ask, hopefully this will be the last question tho. How exactly do I setup the file so in the condition builder it will be variable 1. Again I've looked in the NT help for how to do this and couldn't find any help anywhere.

                        Then once its been set to variable1. In the condition builder how do I set it up?
                        Is it simply click on variable 1 on the LHS, then put an = in the middle, then what do I put on the RHS?

                        Thanks for all the help Bertrand.

                        Comment


                          #13
                          No worries, the setup would be all done in the Condition Builder - so from the User Variables on the left side you pick which one you want to set / update in value. In the middle you have the operator for comparison (so would left side be equal to right, or greater / smaller). Using an equal sign here would check for the user variable to have a specific value, which is then used as part of your overall condition (all blocks you enter in one set are connected via AND, so all need to happen in order to trigger an action).

                          The lower part 'do the following' would trigger the action as result of hitting your condition here the condition builder would allow to set a variable value as well - which we take advantage of to stop trading for the day once one entry has hit. Then later in the day with your variables being set an entry could not happen again since one requirement is that the specific tracking user variable has a value of 0, which it only would have if we had it reset to this value at the beginning of the session - which would allow the script to reenter.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Ohhhh

                            Ohhh. I get it. I tried to start a new strategy. I didn't realize that I had to open up that file in Ninjascript edit strategy. Sori Bertrand.

                            Thanks for all ur help.

                            Av a good1.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by kevinenergy, 02-17-2023, 12:42 PM
                            117 responses
                            2,766 views
                            1 like
                            Last Post jculp
                            by jculp
                             
                            Started by Mongo, Today, 11:05 AM
                            5 responses
                            15 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Deleted: SightCare Australia Reviews by SightCareAubetter
                            Started by SightCareAubetter, Today, 12:55 PM
                            Topic deleted by NinjaTrader_LuisH
                            Started by traderqz, Today, 12:06 AM
                            8 responses
                            16 views
                            0 likes
                            Last Post traderqz  
                            Started by SightCareAubetter, Today, 12:50 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post SightCareAubetter  
                            Working...
                            X