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

No correctly reverse

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

    No correctly reverse

    Hello, i am programming a simple strategy where i want to do a simple reversal of my orders but when i set more than 1 contract in a future market NT seems to dont close correctly the old oders and close several minutes after...

    My code is simple:

    EnterLong(OrderQuantityVar,""); // For Enter a long...
    and
    EnterShort(OrderQuantityVar,""); // For enter a short...

    OrderQuantityVar is equal to 10 in the example

    Why the revesal dont happend there? Whay some contract are pending if the graph show the close of all 10 contracts?

    Look the image please

    Could you help me please? Thank you


    #2
    Hello marynja,

    Thank you for your post.

    The total quantity is being reversed as 10, but not in one order. Is there anything that effects the OrderQuantityVar? Is it set based on partial fills at any point?

    Comment


      #3
      No, OrderQuantityVar dont change
      and no partial fills.

      Its strage because not happend always, only in some trades.

      Thank you.

      Comment


        #4
        Hello marynja,

        Thank you for your response.

        The total quantity is in fact ten (10), correct? If so, I do not understand what you are attempting to detail as I am seeing reversals in your chart at the points you indicate there are no reversals.

        Comment


          #5
          The same trade with 1 contract and 10




          Comment


            #6
            Hello marynja,

            Thank you for your response.

            If your stops close the position there is nothing in your strategy that would then force a reversal. ExitOnClose will also not enforce a reversal, you may wish to set ExitOnClose to false.

            Comment


              #7
              ExitOnClose = false launch the same results.

              The strategy open a 10 long contracts with EnterLong(OrderQuantityVar,""); and in a point the strategy call EnterShort(OrderQuantityVar,""); and open a 10 short contracts.

              I supused that the platform close automatially the longs and open the shorts...

              And i think its correct because works in the mayory of trades.. but whats happend in others? Its a mistery for me.

              Comment


                #8
                Hello marynja,

                Thank you for your response.

                May I test your strategy on my end? If so, please attach the strategy to your response. You will find the strategy in the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Strategy.

                Comment


                  #9
                  Its strange. Seems an erro of the NT graphinc method because the 10 orders are complete in the text of markers.


                  Comment


                    #10
                    Ok PatrickH thanks

                    Comment


                      #11
                      look othe strange thing. When i disconnect from last image NT warming it

                      1 open position
                      7 active orders?


                      Comment


                        #12
                        Hello marynja,

                        Your position of 10 is considered 1 position or 1 instrument has an open position. The orders would be viewed on the Orders tab of the Control Center.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by set2win, 08-04-2021, 09:23 AM
                        39 responses
                        1,001 views
                        0 likes
                        Last Post WaleeTheRobot  
                        Started by md4866, Today, 08:15 PM
                        0 responses
                        8 views
                        0 likes
                        Last Post md4866
                        by md4866
                         
                        Started by mjbatts91, Yesterday, 04:48 PM
                        2 responses
                        23 views
                        0 likes
                        Last Post mjbatts91  
                        Started by pibrew, Today, 06:10 PM
                        1 response
                        22 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by actualfacts.2021, 07-25-2021, 03:11 PM
                        8 responses
                        1,188 views
                        0 likes
                        Last Post linkcou
                        by linkcou
                         
                        Working...
                        X