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 sidlercom80, 10-28-2023, 08:49 AM
    173 responses
    2,336 views
    0 likes
    Last Post intelligenttrader  
    Started by ArkansasClint, 04-25-2024, 09:28 AM
    1 response
    23 views
    0 likes
    Last Post Leafcutter  
    Started by NM_eFe, Today, 06:14 AM
    0 responses
    5 views
    0 likes
    Last Post NM_eFe
    by NM_eFe
     
    Started by sgordet, Today, 06:04 AM
    0 responses
    4 views
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by bc24fl, 08-30-2019, 01:58 PM
    4 responses
    260 views
    0 likes
    Last Post PaulMohn  
    Working...
    X