Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss for manual entry or an existing position

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

    SetStopLoss for manual entry or an existing position

    Good morning .

    I am writing a strategy that needs to assume an existing account position upon startup and then place a stop loss and profit target order around the existing position.

    protected override void OnBarUpdate()
    {
    SetStopLoss(CalculationMode.Currency, 500);
    SetProfitTarget(CalculationMode.Currency, 500);​
    }

    The problem is SetStopLoss() and SetProfitTarget() do not execute around the adopted account position upon strategy startup.​ Is there any way to set a loss stop for entry order placed manually or by another sttategy ?

    Thanks in advance !

    #2
    Hello judysamnt7,

    Below is a link to an example of adopting an account position.


    Unfortunately, using set methods will not work in this manner as there isn't an entry order for the strategy to attach to. The unmanaged approach is used as this allows for placing protective exit orders without an entry.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X