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

Limit order with isLiveUntilCancelled not being setup

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

    Limit order with isLiveUntilCancelled not being setup

    Hi forum,

    Im having problems with a limit order that is not being setup with the isLiveUntilCancelled set to true parameter but does get set up without it. I have TraceOrders set to true and nothing hsows in the log when isLiveUntilCancelled is used.

    I have Print calls before and after the EnterLongLimit, they both execute in both cases.

    Any clues on why could this be happening/solved?

    #2
    Hello morkut,

    Thank you for your post.

    Please clarify what you mean by, "a limit order that is not being setup with the isLiveUntilCancelled set to true parameter but does get set up without it." What is your logic for the limit order? Please provide a snippet to demonstrate, including the print statements that you are seeing as well.

    I look forward to your reply and assisting you further.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Here is a snippet:

      Code:
      if (condition)
      {
      Debug("Price is above entry level.");
      Debug("Placing a buy limit since we are above the entry level.");
      EnterLongLimit(NumberContracts1, enterPrice, "Long1");
      Debug("Here");
      
      }
      This previous code does make a limit order to appear in the chart but the following does not:

      Code:
      if (condition)
      {
      Debug("Price is above entry level.");
      Debug("Placing a buy limit since we are above the entry level.");
      EnterLongLimit(0, true, NumberContracts1, enterPrice, "Long1");
      Debug("Here");
      
      }
      Both produce the print statements (Debug function is just a wrapper).​​

      Comment


        #4
        Originally posted by morkut View Post
        Hi,

        Here is a snippet:

        Code:
        if (condition)
        {
        Debug("Price is above entry level.");
        Debug("Placing a buy limit since we are above the entry level.");
        EnterLongLimit(NumberContracts1, enterPrice, "Long1");
        Debug("Here");
        
        }
        This previous code does make a limit order to appear in the chart but the following does not:

        Code:
        if (condition)
        {
        Debug("Price is above entry level.");
        Debug("Placing a buy limit since we are above the entry level.");
        EnterLongLimit(0, true, NumberContracts1, enterPrice, "Long1");
        Debug("Here");
        
        }
        Both produce the print statements (Debug function is just a wrapper).​​
        When you enable the strategy, what is the color of the strategy name on the Strategies tab of the Control Center? If it is yellow, that means that the strategy is calculated to be in an open virtual position, and the platform is waiting for that position to become flat before it submits any orders to the live account position. For more information about the strategy position vs. account position and syncing the positions:Do you see any TraceOrders output, even prior to the print statements being sent to the NinjaScript Output window?

        I look forward to your reply.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          The color is yellow and now a message appears in the output which states that the order is being ignored:
          Code:
          Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
          EntryHandling is set to AllEntries and I have 1 entry max per direction.

          Im testing it in playback mode.

          Comment


            #6
            Hello morkut,

            Thank you for your reply.

            The strategy name in yellow means that the strategy has calculated it's virtual historical position and determined it would be an open position at the time that you enabled the strategy. Depending on your strategy's start behavior in the settings, it will wait until that virtual position is flat to begin submitting orders to the account on which the strategy is applied. Please see the links from my previous post about the strategy position vs. the account position as well as the syncing account positions page, which describes each of the different possible start behaviors.

            Thank you for your time and patience.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              Thanks for the post, I have used the State.Historical to filter out this behaviour and works well.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ageeholdings, Today, 07:43 AM
              0 responses
              6 views
              0 likes
              Last Post ageeholdings  
              Started by pibrew, Today, 06:37 AM
              0 responses
              4 views
              0 likes
              Last Post pibrew
              by pibrew
               
              Started by rbeckmann05, Yesterday, 06:48 PM
              1 response
              14 views
              0 likes
              Last Post bltdavid  
              Started by llanqui, Today, 03:53 AM
              0 responses
              6 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              12 views
              0 likes
              Last Post burtoninlondon  
              Working...
              X