Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

orders problems

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

    #16
    For example :
    Attached Files

    Comment


      #17
      Hello,

      Thank you for the additional details.

      After running the script and looking at the settings you provided I believe i see what is happening.

      Because you are generating a unique signal name for each order and you are also using the UniqueEntries in your Order handling this can open up the possibility of opening multiple positions in a direction.

      For the script to work as expected you would want to change this from unique to AllEntries. This will prevent the script from submitting another order if you are already in a position.

      Can you please try the changes here and let me know if you still are getting the double orders?

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #18
        orders problems

        Hello !


        I tried to change the parameters : AllEntries

        but nothing change ;

        I'll try the others parameters


        Thank for your answer
        Regards


        ES UT 1mn
        Attached Files

        Comment


          #19
          Hello !

          I tried the others parameters without success ...



          Regards

          Comment


            #20
            Hello,

            I was looking through the script again and had noticed what looks like the cause. I still have not been able to reproduce this on my end but I believe this would be it based on the action the logic is taking.

            It looks like there is an exit and a entry happening on the same bar which does not give NinjaTrader enough time to know that this happened to let the second order know the correct position.

            In both your OpenShortTrade() and OpenLongTrade() you have the following:

            Code:
            if (IsShort)
            	ExitShort();
            else if (IsLong)
            	return;

            Followed by a
            Code:
            _order = this.EnterLong(_contracts, _signal);

            which would be an exit followed by an entry in the same bar. Instead of using the ExitShort here you would want to use EnterLong as it will exit your short position automatically.

            essentially this logic is saying to buy 1 to exit and then buy 1 to exit and then buy 1 to enter a long position.
            The same would go for the opposite direction.

            Please try removing the exits and replacing them with your entry in the opposite direction.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #21
              orders problems

              Now everything works fine, thank you very much for your help !!!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Segwin, 05-07-2018, 02:15 PM
              14 responses
              1,788 views
              0 likes
              Last Post aligator  
              Started by Jimmyk, 01-26-2018, 05:19 AM
              6 responses
              837 views
              0 likes
              Last Post emuns
              by emuns
               
              Started by jxs_xrj, 01-12-2020, 09:49 AM
              6 responses
              3,293 views
              1 like
              Last Post jgualdronc  
              Started by Touch-Ups, Today, 10:36 AM
              0 responses
              13 views
              0 likes
              Last Post Touch-Ups  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              11 responses
              63 views
              0 likes
              Last Post halgo_boulder  
              Working...
              X