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

Stop order problem

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

    Stop order problem

    This has probably been covered before, if so if you could jsut direct me to the appropriate thread.
    I am testing a breakout system using stop order entries. The problem Im having is sometimes the price is already above the stop price before my order goes in, I would expect it then to just enter as a market order, but instead it gets rejected and shuts down. Is there any way around this?

    Thanks

    #2
    maninjapan,

    You should check for appropriate valid prices before submission. Unfortunately submitting a stop order at an invalid price does lead to rejections at the exchange and there is no way around that.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Is there any example of how to do this?
      Ideally, I would like it to enter @ market if the order price is 'Invalid'.

      Thanks

      Comment


        #4
        You just have to check the stop price you are submitting at versus the currently traded price. If it is invalid, submit as a market order instead of a stop order. You will not be able to submit stop orders at invalid prices.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          thanks, I understand what I need to do now, but an example would be extremely helpful if there was an example of some description as I am new to chartscripts and dont really know how I would go about this.

          Thanks,

          Comment


            #6
            Code:
            if (some trade conditions)
            {
                 if (Close[0] > stopPrice)
                      EnterLong();
                 else
                      EnterLongStop(...);
            }
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks Josh, Ill give it a go

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              59 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              21 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              10 views
              0 likes
              Last Post cre8able  
              Working...
              X