Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Starting a strategy in middle of session

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

    #16
    Thanks Josh. Took a couple of tries but finally got it to work. When you said "bracket" I thought you meant parenthesis

    Comment


      #17
      Sorry for the confusion. Glad you got it to work.
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Ok i am thick headed of course and im shure it would solve issues for allot fo people with screen shots, BUt what is a "bracket" I would like to do this and have no cluse what you are talking about.

        Thanks

        Tim

        Basically this is what i see

        ///<summary>
        /// Called on each bar update event (incoming tick)
        ///</summary>
        protectedoverridevoid OnBarUpdate()

        where do i put what is stated here??

        after OnBarUpdate () or before or below above?? and wheres the brackets
        Last edited by timmyb; 03-13-2008, 02:16 PM.

        Comment


          #19
          By bracket I mean these characters: { }

          You should see this on your end:
          Code:
          [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()
          {
               // blahbalhala;
          }[/SIZE][/FONT][/SIZE][/FONT]

          You want to place the code snippet at the beginning of the OnBarUpdate() method which means INSIDE the { }s.
          Code:
          [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff] void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()
          {
               if (Historical)
                    return;
          
               // blahbalhala;
          }[/SIZE][/FONT][/SIZE][/FONT]

          Josh P.NinjaTrader Customer Service

          Comment


            #20
            thanks josh, i figured it out, but i am sure that post will helps many a newb find their footing.

            Comment


              #21
              Originally posted by timmyb View Post
              thanks josh, i figured it out, but i am sure that post will helps many a newb find their footing.

              Thanks a lot for this discussion.. Although I am late to the party but I wanna ask a follow up question.. just to make sure i get it right..

              If i set the option to
              "Wait until flat before executing live"
              it will essentially help the LIVE account positions get in sync (position wise) with the Strategy postions?

              Is that right?

              If it is right then I have a suggestion. Please update the thread
              http://www.ninjatrader-support2.com/...ead.php?t=4033 to include this as a method to sync the account.
              The current method to put the accounts in sync is a lil scary .. as it is suggesting the user to put a live order to make the accounts in sync.... the trade might already have played out and still the user is forced to submit the trade just to make the account sync... I wont do it and i am sure many wont...


              Please also include this as part of documentation where this is discussed. :-)
              it will be great to have the
              If (historical)
              return;

              solution also listed there.. I know it will be useful cus it took me a while to stumble upon this thread to find the solution.

              Thanks
              Rishi

              Comment


                #22
                "Wait until flat" does not help you actively sync. It is just an alternative if you know for a fact that you have a flat account position. It will not help you in anyway if your account position is not flat. The article was designed for people with active account positions and differing strategy positions.

                if (Historical) return; is in the Help Guide.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  I know this is an old thread but I was wondering if the current version of NJT has an easier way of handling this issue?

                  Comment


                    #24
                    Hello dtf139,

                    Nothing has changed in NT7 in regards to synchronizing your Strategy Position vs your Account Position which is what I believe you were inquiring about.

                    A good video that goes over all the different options can be found on our YouTube page at the following link.
                    Download NinjaTrader FREE at http://www.ninjatrader.comThis video demonstrates the differences between Strategy positions and Account positions and how to sy...


                    If you have a suggestion on how this can be made easier I can forward it to our Development team, but how it is setup currently is to have the most flexibility.

                    Happy to be of further assistance.
                    JCNinjaTrader Customer Service

                    Comment


                      #25
                      I'm not a programmer and so everything I do is through the strategy wizard.
                      I have been mostly using NJT for intraday trading but I am now testing daily bars and longer hold times.
                      My problem right now is that if for some reason my daily strategy does not get started before the start of the session then NJT will not enter any trades if the strategy position is long already. I simply want a way to force NJT to enter a live position regardless of what the "strategy position" is. I know from the previous conversations that you can do that using if(historical) but that requires editing the strategy manually but after that the strategy cant be tweaked or changed through the wizard.
                      Last edited by dtf139; 07-25-2013, 04:09 PM.

                      Comment


                        #26
                        Hello dtf139,

                        In the video that I linked it goes over how to setup your strategy to have NinjaTrader submit an order for you automatically if your Strategy is in a position when you start it up.

                        If you go to Tools -> Options -> Strategies tab -> NinjaScript tab you may set NinjaTrader to "Immediately submit live working historical orders". This basically means that even if your Strategy is in a position historically if a trigger to submit an order is hit NinjaTrader will send the order regardless of your Account Position.

                        Now if you want to make sure that your Strategy Position and your Account Position match you will want to Sync them. So basically if your Strategy is in a position NinjaTrader will submit orders to match your Account with you Strategy. To enable "Sync account Position" go to your Strategy parameters and set it to true.

                        This will require no custom programming.

                        Let us know if you have any questions.
                        JCNinjaTrader Customer Service

                        Comment


                          #27
                          Thank You JC. That video really helps explain what the settings actually do.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by NM_eFe, Today, 10:13 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post NM_eFe
                          by NM_eFe
                           
                          Started by hdge4u, Yesterday, 12:23 PM
                          1 response
                          10 views
                          0 likes
                          Last Post hdge4u
                          by hdge4u
                           
                          Started by 1001111, Today, 09:45 AM
                          0 responses
                          4 views
                          0 likes
                          Last Post 1001111
                          by 1001111
                           
                          Started by DTSSTS, 01-28-2024, 12:07 PM
                          11 responses
                          557 views
                          0 likes
                          Last Post bmo111
                          by bmo111
                           
                          Started by Torontobluejays, Today, 08:43 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post Torontobluejays  
                          Working...
                          X