• 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

  • pman777
    started a topic EnterShortStopLimit

    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

  • pman777
    replied
    thanks Paul ... that's a great start for me! Appreciate it.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello pman777,

    Thanks for your reply.

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

    Leave a comment:


  • pman777
    replied
    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

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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.

    Leave a comment:


  • pman777
    replied
    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?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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?

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by pulpiwapi, 03-04-2019, 11:18 PM
11 responses
143 views
0 likes
Last Post music_p13  
Started by indy73, Yesterday, 10:52 PM
3 responses
17 views
0 likes
Last Post sledge
by sledge
 
Started by priceisking, Today, 12:51 PM
1 response
18 views
0 likes
Last Post NinjaTrader_PaulH  
Started by chartish, Today, 10:33 AM
3 responses
27 views
0 likes
Last Post chartish  
Started by casabella, Today, 11:51 AM
1 response
10 views
0 likes
Last Post NinjaTrader_PaulH  
Working...
X