Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target works for long but not short

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

    Profit target works for long but not short

    Code:
                {
                EnterLongLimit(DefaultQuantity, Close[0], "");
                SetProfitTarget("", CalculationMode.Ticks, ((High[1]-Low[1])*100)/2);
                SetStopLoss("", CalculationMode.Ticks, ((High[1]-Low[1])*100)*1.5, false);
                }
    this works fine for long

    but if i inverse the above to:

    Code:
                {
                EnterShortLimit(DefaultQuantity, Close[0], "");
                SetProfitTarget("", CalculationMode.Ticks, ((High[1]-Low[1])*100)/2);
                SetStopLoss("", CalculationMode.Ticks, ((High[1]-Low[1])*100)*1.5, false);
                }

    the profit target does not get set but stoploss does.

    #2
    Hello calhawk01,

    If you place TraceOrders = true inside of your Initialize() do you get any messages in your Output Window regarding the Profit Target Order?

    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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