• 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

EnterShortStopLimit

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

    EnterShortStopLimit

    Hi, need help with my entry/stop logic. Hereís what I want to do: execute a short trade at a certain price level below the current bid price. To do this, my strategy executes an EnterShortStopLimit at that lower price level while the current price is still above it. (fyi, I use the long form of that method as I need to set isLiveUntilCancelled to true so the order doesnít cancel at the end of the bar.) I also set the EnterShortStopLimit stopPrice at 5 ticks above the EnterShortStopLimit limitPrice.

    As soon as the current price moves to the EnterShortStopLimit limitPrice and my strategy enters a short position, I then want to reset my EnterShortStopLimit stopPrice value based on some other variables Iím calculating. To do this, I then execute a SetStopLoss for that new stop price. This is where I consistently get the message ďStop price canít be changed below the marketĒ.

    Iíve looked at some example strategies to see where Iím going wrong but couldnít find anything. Iím sure my use of the above commands, or where they are placed is flawed. Any insight you can provide is greatly appreciated! Thanks

    #2
    Hello pman777,

    Thanks for your post.

    We recommend debugging your strategy by printing the variables that are "based on some other variables Iím calculating" to ensure that an appropriate price is being used for the SetStopLoss(). Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

    Can you clarify if this is correct, "I also set the EnterShortStopLimit stopPrice at 5 ticks above the EnterShortStopLimit limitPrice." I'm not sure why you would do that because then the order would be placed above the current price. Did you mean ExitShortStopLimit?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you Paul for replying so quickly. I did debug and the value is what I expected.
      Let me explain my thinking when I said "I also set the EnterShortStopLimit stopPrice at 5 ticks above the EnterShortStopLimit limitPrice." Iím assuming that this the stopPrice once my order is executed and price falls thought the limitPrice to place me in a short position. I realize I may be thinking about this wrong. Iím not sure if I should be using an ExitShortStopLimit?

      Is there an example strategy you can direct me to that uses a Managed EnterShortStopLimit and ExitShortStopLimit where the stopPice for an active order is modified?

      Comment


        #4
        Hello pman777,

        Thanks for your reply.

        There would be no example code because using Exit methods with SetStopLoss would violate the Internal Order Handling Rules that Reduce Unwanted Positions. Reference: https://ninjatrader.com/support/help...d_approach.htm

        Regarding SetStopLoss(), you will need to set the price level before you enter the position because the SetStopLoss() retains the last price you used for the stop and then immediately applies the stop upon entry and that likely would be the issue.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Ignoring what I was doing (previous comments) is there a strategy example you can direct me to where either a SellStopLimit or a BuyStopLimit is being used (Managed approach). I don't think I'm understanding how to structure these entries ... an example may help. thanks again

          Comment


            #6
            Hello pman777,

            Thanks for your reply.

            I'm not aware of an example so I created a quick one using EnterLongStopLimit().
            Attached Files
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              thanks Paul ... that's a great start for me! Appreciate it.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by shmarola, Today, 01:01 AM
              0 responses
              1 view
              0 likes
              Last Post shmarola  
              Started by CriticalMind, 11-29-2015, 12:39 PM
              3 responses
              1,321 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by novel168, 06-14-2019, 09:20 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by johnnybegoode, Yesterday, 08:00 PM
              3 responses
              9 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by digibob, Yesterday, 03:00 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X