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

SetProfitTarget

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

    SetProfitTarget

    Hi,

    I have been using:

    EnterLongLimit()
    with
    SetStopLoss()
    and
    SetProfitTarget()

    and these have been working fine. However I recently had an in-flight issue after a partial fill, whereby my original trade position was not confirmed back as fully filled and my stop and target orders ended up being rejected as they took my net worst-case position over my account limit.
    To prevent another in-flight issue I would like to delay the SetProfitTarget() half of the order by a few ticks or, say by a 1min bar update, in order that the original trade will always be confirmed back before both stops and target orders get sent in.
    However, when I delay the SetProfitTarget() by a bar it does not get sent, and I only get a stop with my position, no target limit order.
    Is there a way to delay this SetProfitTarget() so that it is still tied to my trade? thanks

    #2
    Originally posted by Pourleau View Post
    Hi,

    I have been using:

    EnterLongLimit()
    with
    SetStopLoss()
    and
    SetProfitTarget()

    and these have been working fine. However I recently had an in-flight issue after a partial fill, whereby my original trade position was not confirmed back as fully filled and my stop and target orders ended up being rejected as they took my net worst-case position over my account limit.
    To prevent another in-flight issue I would like to delay the SetProfitTarget() half of the order by a few ticks or, say by a 1min bar update, in order that the original trade will always be confirmed back before both stops and target orders get sent in.
    However, when I delay the SetProfitTarget() by a bar it does not get sent, and I only get a stop with my position, no target limit order.
    Is there a way to delay this SetProfitTarget() so that it is still tied to my trade? thanks
    I believe the Set methods must be in place before the trade is entered. To do what you want, you are going to have to use ExitLongLimit() to set your profit target. You probably want to use OnExecution() or OnPositionUpdate() to determine the exact quantity you need for your ExitLong.

    NT has a reference sample, ref: http://www.ninjatrader.com/support/f...ead.php?t=7499

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    6 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X