Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

help on SetProfitTarget/StopLoss/TrailStop

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

    help on SetProfitTarget/StopLoss/TrailStop

    Hi,

    I'm trying to do this with one cancel another if filled:

    a. Set profit target at 300 pips
    b. Set initial stop loss at 50 pips (upon entry, it goes up/down 50pips)
    c. Set trailing stop loss at 100 pips (after it runs)

    I uses the following commands:

    SetTrailStop("EntSet1", CalculationMode.Ticks, 100, false);
    SetProfitTarget(
    "EntSet1", CalculationMode.Ticks, 200);
    SetStopLoss(
    "EntSet1", CalculationMode.Ticks, 50, false);

    However, it ignored the SetTrailStop and only recognize the SetStopLoss. If I take away, SetStopLoss, then SetTrailStop will work. Is it posible to have all 3 work together?

    Regards,
    Toyogo

    #2
    Unfortunately you cannot use SetStopLoss and SetTrailStop simultaneously on the same order. To do what you want will require you to use SetStopLoss, but modifying the order as it starts running. Please see these reference samples: http://www.ninjatrader-support.com/v...ead.php?t=3222


    The solution is a bit more on the complex end.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks. another question:

      How can I run two sets of entries and setstoploss with both sets of entries are active? eg.

      protectedoverridevoid Initialize()
      {
      SetProfitTarget("EntSet1", CalculationMode.Ticks, 200);
      SetStopLoss("EntSet1", CalculationMode.Ticks, 100, false);

      SetProfitTarget("EntSet2", CalculationMode.Ticks, 100);
      SetStopLoss("EntSet2", CalculationMode.Ticks, 50, false);
      }

      protectedoverridevoid OnBarUpdate()
      {
      if (cond1)
      EnterLongLimit(DefaultQuantity, 1.4625, "EntSet1");

      if (cond2)
      EnterLongLimit(DefaultQuantity, 1.4732,"EntSet2");
      }

      Comment


        #4
        You will need to increase the EntriesPerDirection to 2. Alternatively you can change EntryHandling to EntryHandling.UniqueEntries. Please see: http://www.ninjatrader-support.com/H...yHandling.html

        Then what you have outlined there will be needed; you need to specify unique entry names and link your SetStopLoss()/SetProfitTarget() sets to their entry names.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by elirion, Today, 09:32 PM
        0 responses
        3 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by cre8able, Today, 09:15 PM
        1 response
        7 views
        0 likes
        Last Post bltdavid  
        Started by cummish, Today, 08:43 PM
        0 responses
        12 views
        0 likes
        Last Post cummish
        by cummish
         
        Started by Option Whisperer, Today, 07:58 PM
        4 responses
        21 views
        0 likes
        Last Post Option Whisperer  
        Started by ETFVoyageur, 05-07-2024, 07:05 PM
        13 responses
        87 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X