Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time element for starting & stopping strategy

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

    Time element for starting & stopping strategy

    Can I have a link for a video demonstrating in the strategy builder (I don't want to unlock script to do it that way) to add time of day to begin and to end the strategy.

    ************************************************** **********
    There's a market clock that exist which is every 90 minutes from; 9am - 1030 // 10:30 -1200 // 12:00 - 1:30 // 1:30 - 3:00 // 3:00 - 4:30 // 4:30pm - 9:00am

    When u can learn to understand what's happening & why with the settling of accounts u can identify consolidation time periods ahead of time and it's in between those times within 15 to 20 minutes
    and to stay out, thats where u get eaten up. One sect goes into a trend and the next one settles those positions before the next trend picks up.
    There are ways to read into it as far as who won the period bulls or bears & who's likely to own the next period.

    Alan Farley's book Master Swing Trader has a whole chapter on this. It's pretty amazing. Makes me want to go read it again. It's a good study.
    (any novice trader reading this go get that book) (Just pushing my two cents)
    Attached Files
    Last edited by trdninstyle; 11-29-2022, 10:47 AM.

    #2
    Hi trdninstyle, thanks for posting. Our colleague made an example here that will be useful:

    Hello, I am building a strategy to use with the MACD indicator and am trying to have it turn on at specific times to place an order. For example, turn on the strategy from 1:30-2:00am and then reactivate at 3:00-3:30am etc. for multiple times throughout the day. I have built 5 separate strategies for the times I want, however


    Kind regards,
    -ChrisL​
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris L.

      It's interesting that Polufson times are similar to what I was explaining. I'm sure it's no coincidence since that is actually a made-up word in our English vocabulary, coincidence.
      There is no coincidence but there are appointed times and seasons.
      Last edited by trdninstyle; 11-29-2022, 04:15 PM.

      Comment


        #4
        It gets confusing reading all that. I remember seeing Chelsea in one of his videos demonstrating adding that time element, but I couldn't find it.
        But I do want one trade canceling out a current trade for the other direction, I saw something on that.

        Comment


          #5
          Hi trdninstyle, thanks for the follow up. There is an example of setting up a time filter here:

          NinjaTrader's Strategy Builder empowers traders of all levels with point-and-click automated trading strategy development. Create your own advanced automated...


          To automatically reverse a position, you can call EnterLong() and EnterShort(). E.g. if you are in a long position, calling EnterShort() will automatically close the open Long position and open a new Short position.

          Kind regards,
          -ChrisL​
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            That is the video that I saw which I couldn't find, thank you for that Chris.

            I just need to understand a little more on how to specifically enter short as well as long, so it reverses the other. Is it all in the same line, that I say that? Here's a pic of what I mean.
            I successfully created a short version for the long strategy, I have both long & short going but in separate strategies.

            I'm going to combine them to one complete strategy like in a week or something. Does it matter if I have long & short strategies separate?
            Attached Files

            Comment


              #7
              Hi trdninstyle, I attached a test strategy if you would like to try it out. It goes long first then it reverses over and over. The long and short conditions should be in separate sets.
              Attached Files
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Wow thats pretty good. I'm glad too that it's in the builder that way I can really look at it. Thats almost a strategy all by itself I would have to modify it of course.
                AIL and AIS (Always In Long and Always In Short)

                Have you heard of anyone making that their strategy? But instead of going short have it go flat then pick it up again long, I'm thinking on my feet, don't know yet.
                Do the opposite for shorts. Thanks for showing me that. I feel like a mad scientist.

                Comment


                  #9
                  Hi Chris,

                  I'm not sure how to apply the TestLongShortBool to my existing trailstop strategy. Do I overlay the 3 set unto my first 3 of 5 set? (5th set is something I added)
                  I use all 3 sets, don't I? It won't work otherwise. Thank you.
                  Attached Files

                  Comment


                    #10
                    Hi trdninstyle, You should use all 3 sets for the logic to work. Set 3 is checked last because if we checked that first, it would set our Bool to true and the two "working" sets would activate right after that. The most important thing to understand about these sets is that they are checked one after the other. All of them go into the OnBarUpdate method, which is called on the close of every bar by default. It can run OnEachTick but that is not important for this example. It looks like this in the actual code behind:

                    OnBarUpdate() //runs every bar close
                    {

                    //set 1
                    if(<set 1 conditions>)
                    {
                    //set 1 actions
                    }

                    //set 2
                    if(<set 1 conditions>)
                    {
                    //set 2 actions
                    }

                    }
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      Thanks for that. I haven't unlocked it yet. It's interesting how it works but using the builder, how does the 3 sets mix with the 4 sets (Not counting the 5th)
                      What I mean is, I already just added the 3 at the end of my 5 set but didn't work.

                      Do the 3 sets get added in with the first three sets of my 5-set trail stop? Liked, add the language to it.

                      Set 1 Set 2 Set 3 Set 4 Set 5 ... Set 1 Set 2 Set 3

                      Or

                      Set 1 Set 2 Set 3 Set 4 Set 5
                      Set 1 Set 2 Set 3 (As one)

                      Comment


                        #12
                        Hi trdninstyle, thanks for the follow up. Our colleague already has an example of a trailing stop here, but please keep in mind that the strategy builder was meant to make simple strategies. You will likely need to unlock the script to get a strategy that reverses and also handles a trailing stop. Unfortunately, the support team will not be able to create new examples or debug/fix any custom scripts. This is so we can respond to all help requests in a timely manner.

                        Chris L.NinjaTrader Customer Service

                        Comment


                          #13
                          So, I will have to unlock it to have both, trailing & reversing? It can't be done in the builder, then.
                          Thank you, I appreciate all the help.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by chrischongpdx, Today, 09:39 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post chrischongpdx  
                          Started by Mountain_cast, Today, 12:41 PM
                          2 responses
                          9 views
                          0 likes
                          Last Post Mountain_cast  
                          Started by dontpanic, 04-07-2015, 04:42 AM
                          4 responses
                          1,322 views
                          0 likes
                          Last Post BeachTrader11807  
                          Started by algospoke, Today, 07:54 PM
                          0 responses
                          5 views
                          0 likes
                          Last Post algospoke  
                          Started by Rxxar, Today, 06:26 PM
                          0 responses
                          10 views
                          0 likes
                          Last Post Rxxar
                          by Rxxar
                           
                          Working...
                          X