• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Avoiding trading at the opening

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

    #16
    Hello cachevery,

    Thank you for your response.

    Is it possible to attach that file to your response so I may test your most up to date version?
    Patrick H.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_PatrickH View Post
      Hello cachevery,

      Thank you for your response.

      Is it possible to attach that file to your response so I may test your most up to date version?
      Ah,sorry.Ok,i`ll PM it to you.

      Comment


        #18
        Hello cachevery,

        Thank you for your patience.

        I am not seeing the items Cal pointed you towards in your code. Have you added the lines Cal provided to your script but did not provide this section? Or are you looking for how to add this to your script at this point?
        Patrick H.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_PatrickH View Post
          Hello cachevery,

          Thank you for your patience.

          I am not seeing the items Cal pointed you towards in your code. Have you added the lines Cal provided to your script but did not provide this section? Or are you looking for how to add this to your script at this point?

          no,i didn`t add the lines Cal suggested.The snippet is as is.

          Comment


            #20
            cachevery, we're sorry but don't follow your latest reply here - could you please clarify further? We could not create the script modifications for you, but have started working with you so you can hopefully make the changes needed on your end. An alternative might be working together with a consultant.
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Bertrand View Post
              cachevery, we're sorry but don't follow your latest reply here - could you please clarify further? We could not create the script modifications for you, but have started working with you so you can hopefully make the changes needed on your end. An alternative might be working together with a consultant.
              What do i need to clarify,exactly?The request was to add the conditions to the strategy,prevent it working on opening.For e.g,the first hour.I sent the snippet code to you via PM.

              Comment


                #22
                Cal`s snippet does not work

                Comment


                  #23
                  Cachevery,

                  My snippet is simply sample on how to calculate and have the script wait a set number of bars and then do any action that you want.
                  The first condition checks that the current bar is the first bar of the session. It then assigns that current bar's value to startingBar.
                  Then in the second condition we look for when most current bar minus the startingBar value is equal to 7, meaning that 7 bars have passed since the first bar of the session.

                  Code:
                  //This will set the CurrentBar value to the startingBar variable
                  	if(Bars.FirstBarOfSession)
                      		startingBar = CurrentBar;
                  
                  //We then check the CurrentBar minus the startingBar value and ensure that it is greater than or equal to the set
                  //Value that is set, this case 7 bars
                  	if(CurrentBar - startingBar >= mySetValue)
                  	{
                  		//Do any action here such as trades
                  	}
                  The startingBar and mySetValue are int variables that you will declare in the variable section

                  Code:
                  private int mySetValue = 7;
                  private int startingBar = 0;
                  Last edited by NinjaTrader_CalH; 07-02-2014, 07:47 AM.
                  Cal H.NinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_Cal View Post
                    Cachevery,

                    My snippet is simply sample on how to calculate and have the script wait a set number of bars and then do any action that you want.
                    The first condition checks that the current bar is the first bar of the session. It then assigns that current bar's value to startingBar.
                    Then in the second condition we look for when most current bar minus the startingBar value is equal to 7, meaning that 7 bars have passed since the first bar of the session.

                    Code:
                    //This will set the CurrentBar value to the startingBar variable
                    	if(Bars.FirstBarOfSession)
                        		startingBar = CurrentBar;
                    
                    //We then check the CurrentBar minus the startingBar value and ensure that it is greater than or equal to the set
                    //Value that is set, this case 7 bars
                    	if(CurrentBar - startingBar == mySetValue)
                    	{
                    		//Do any action here such as trades
                    	}
                    The startingBar and mySetValue are int variables that you will declare in the variable section

                    Code:
                    private int mySetValue = 7;
                    private int startingBar = 0;

                    Thanks Cal,i`ll give it another try,Cal.Maybe it was me how did smth wron,Ca-a-a-a-all!

                    Thx

                    Comment


                      #25
                      "//We then check the CurrentBar minus the startingBar value and ensure that it is greater than or equal to the set
                      //Value that is set, this case 7 bars
                      if(CurrentBar - startingBar == mySetValue)
                      {
                      //Do any action here such as trades
                      }"

                      Greater than or equal and you put a double equal sign.Or it is not important?

                      doesn`t work so far...

                      Comment


                        #26
                        Cachevery,

                        That was a typo. It should be >=

                        I corrected my previous statement.
                        Cal H.NinjaTrader Customer Service

                        Comment


                          #27
                          Originally posted by NinjaTrader_Cal View Post
                          Cachevery,

                          That was a typo. It should be >=

                          I corrected my previous statement.
                          Hi Cal,i found that it was the previous bar from the last session that should be removed.How do i do that?I don`t want the closing bar from the previous serssio to be in play in the strategy.

                          Comment


                            #28
                            Cachevery,

                            Can you please provide your latest edition of the script
                            Cal H.NinjaTrader Customer Service

                            Comment


                              #29
                              Originally posted by NinjaTrader_Cal View Post
                              Cachevery,

                              Can you please provide your latest edition of the script
                              Hi Cal,it`s a protected assembly.There`s little in it to change.I can email it to you,or pm the part that is opened.

                              Comment


                                #30
                                Hello cachevery,

                                Thanks for your reply.

                                Please email Cal at platformsupport[at]ninjatrader[dot]com and include a link to this forum topic.
                                BrandonNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Bouzayen, Yesterday, 08:31 PM
                                0 responses
                                13 views
                                0 likes
                                Last Post Bouzayen  
                                Started by IanC28, 03-27-2020, 10:20 AM
                                6 responses
                                29 views
                                0 likes
                                Last Post jim1234
                                by jim1234
                                 
                                Started by aramtrader, 04-01-2020, 03:05 PM
                                7 responses
                                40 views
                                0 likes
                                Last Post woodie1
                                by woodie1
                                 
                                Started by renehtx, Yesterday, 03:51 PM
                                2 responses
                                16 views
                                0 likes
                                Last Post renehtx
                                by renehtx
                                 
                                Started by eidog2020, Yesterday, 03:31 PM
                                0 responses
                                8 views
                                0 likes
                                Last Post eidog2020  
                                Working...
                                X