Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sell limit

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

    Sell limit

    hi since we cant use stoploss and trailstop together, i created a condition that sells after the price goes below a certain threshold:


    Code:
                if (Close[0] < Open[1])
                {
                ExitLong("","");
                }
    the only problem is that this creates a market order. i dont want to send a market order. all my orders are limit orders.

    if i use " ExitLongLimit(0, "", "");"

    then that doesn't work.. i guess the system treats that as a stoploss? and since i have a trailing stoploss on.. it wont execute

    any ideas?

    #2
    Hello calhawk01,

    Thank you for your post.

    You will need to use ExitLongStop() or ExitLongStopLimit().

    For information on ExitLongStop() please visit the following link: http://www.ninjatrader.com/support/h...itlongstop.htm

    For information on ExitLongStopLimit() please visit the following link: http://www.ninjatrader.com/support/h...gstoplimit.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello calhawk01,

      Thank you for your post.

      You will need to use ExitLongStop() or ExitLongStopLimit().

      For information on ExitLongStop() please visit the following link: http://www.ninjatrader.com/support/h...itlongstop.htm

      For information on ExitLongStopLimit() please visit the following link: http://www.ninjatrader.com/support/h...gstoplimit.htm

      Please let me know if I may be of further assistance.
      exitlongstoplimit doesnt work together with trailstoploss

      Comment


        #4
        Hello calhawk01,

        Thank you for your response.

        The ExitLongStopLimit() will work with the SetTrailStop(), I believe you may be referring to the following though:
        • A trail stop order is automatically cancelled if the managing position is closed by another strategy generated exit order
        This means if the ExitLongStopLimit() is submitted and filled the SetTrailStop() will be cancelled.

        For information on ExitLongStopLimit() please visit the following link: http://www.ninjatrader.com/support/h...gstoplimit.htm

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello calhawk01,

          Thank you for your response.

          The ExitLongStopLimit() will work with the SetTrailStop(), I believe you may be referring to the following though:

          This means if the ExitLongStopLimit() is submitted and filled the SetTrailStop() will be cancelled.

          For information on ExitLongStopLimit() please visit the following link: http://www.ninjatrader.com/support/h...gstoplimit.htm
          thank you for the reply

          to solve my problem i'm trying to build a order management logic.

          Code:
                  private void ManageOrders1()
                  {
                      if (Position.MarketPosition == MarketPosition.Long)
                      {
          
                        [B]  if (Close[0] > Position.AvgPrice + target1)
                              SetStopLoss(CalculationMode.Price, Position.AvgPrice);[/B]
                          if (Close[0] > Position.AvgPrice + target2)
                              SetStopLoss(CalculationMode.Price, Position.AvgPrice+1);
                          if (Close[0] > Position.AvgPrice + target3)
                              SetStopLoss(CalculationMode.Price, Position.AvgPrice + target2);
                          if (Close[0] > Position.AvgPrice + target4)
                              SetStopLoss(CalculationMode.Price, Position.AvgPrice + target3);
                          if (Close[0] > Position.AvgPrice + target5)
                              SetStopLoss(CalculationMode.Price, Position.AvgPrice + target4);        
                      }
                  }
          for some reason only the first condition (bolded) is executed. any reason why the later conditions are ignored? i even tried creating separate order management logic for the later conditions, but those are also ignored. FYI, i am entering my order with a setstoploss in COBC. that order is cancelled by the bolded and NT gets me out at breakeven. but i'm not sure why the later are being ignored

          Comment


            #6
            Hello calhawk01,

            Thank you for your response.

            If each target# is greater than the preceding number (1 < 2 < 3, etc.) the first condition checking if the Close is greater than the average price plus target1 will always return true.

            Try the following:
            Code:
            if (Position.MarketPosition == MarketPosition.Long)
                        {
            
                           if (Close[0] > Position.AvgPrice + target5)
                                SetStopLoss(CalculationMode.Price, Position.AvgPrice + target4);    
                           else if (Close[0] > Position.AvgPrice + target4)
                                SetStopLoss(CalculationMode.Price, Position.AvgPrice + target3);
                           else if (Close[0] > Position.AvgPrice + target3)
                                SetStopLoss(CalculationMode.Price, Position.AvgPrice + target2);
                            else if (Close[0] > Position.AvgPrice + target2)
                                SetStopLoss(CalculationMode.Price, Position.AvgPrice+1);
                            else if (Close[0] > Position.AvgPrice + target1)
                                SetStopLoss(CalculationMode.Price, Position.AvgPrice);                    
                        }
            The above reverses the check conditions to ensure the largest is checked first.

            Please let me know if you have any questions.

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello calhawk01,

              Thank you for your response.

              If each target# is greater than the preceding number (1 < 2 < 3, etc.) the first condition checking if the Close is greater than the average price plus target1 will always return true.

              Try the following:
              Code:
              if (Position.MarketPosition == MarketPosition.Long)
                          {
              
                             if (Close[0] > Position.AvgPrice + target5)
                                  SetStopLoss(CalculationMode.Price, Position.AvgPrice + target4);    
                             else if (Close[0] > Position.AvgPrice + target4)
                                  SetStopLoss(CalculationMode.Price, Position.AvgPrice + target3);
                             else if (Close[0] > Position.AvgPrice + target3)
                                  SetStopLoss(CalculationMode.Price, Position.AvgPrice + target2);
                              else if (Close[0] > Position.AvgPrice + target2)
                                  SetStopLoss(CalculationMode.Price, Position.AvgPrice+1);
                              else if (Close[0] > Position.AvgPrice + target1)
                                  SetStopLoss(CalculationMode.Price, Position.AvgPrice);                    
                          }
              The above reverses the check conditions to ensure the largest is checked first.

              Please let me know if you have any questions.
              Thanks Pat, that was a good idea but it's still not doing what i want it to do, it's still exiting at breakeven even though my target 2 is being hit... it should be exiting at avgprice+1.

              let me be more clear, once price goes above target1, set my stoploss to avgprice.. now the price went up to target2, i want to cancel my previous stoploss of avgprice, and replace it with avgprice+1. and so on..

              any other ideas?

              thank you

              Comment


                #8
                Originally posted by calhawk01 View Post
                Thanks Pat, that was a good idea but it's still not doing what i want it to do, it's still exiting at breakeven even though my target 2 is being hit... it should be exiting at avgprice+1.

                let me be more clear, once price goes above target1, set my stoploss to avgprice.. now the price went up to target2, i want to cancel my previous stoploss of avgprice, and replace it with avgprice+1. and so on..

                any other ideas?

                thank you
                i just checked my output window:

                here's what's happening: our logic above is working. once price hit moves past my target1, stoploss is set at avgprice+1. then when price moves to target2, stoploss is set at avgprice+target1. i can verify that in the output window and pending orders.

                however, when price actually starts to retrace, these orders are amended. for example when price starts climbing down from the peak, instead of my stoploss being hit at avgprice+target1, it amends it back to the stoploss at avgprice+1.

                any idea why?


                Code:
                5/9/2013 1:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:05:58 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:05:58 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:30:35 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:30:35 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:31:43 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:31:43 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                [B]5/9/2013 1:34:57 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False[/B]
                5/9/2013 1:34:57 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1628 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                5/9/2013 1:34:57 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:44:07 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:44:07 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:45:25 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:45:25 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:51:32 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                [B]5/9/2013 1:51:32 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:54:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False[/B]
                5/9/2013 1:54:21 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1627 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                5/9/2013 1:54:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 1:58:09 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 1:58:09 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1628 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                5/9/2013 1:58:09 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                5/9/2013 2:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 2:04:46 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1627 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                5/9/2013 2:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 2:09:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 2:09:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 2:09:56 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                5/9/2013 2:09:56 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False

                Comment


                  #9
                  Originally posted by calhawk01 View Post
                  i just checked my output window:

                  here's what's happening: our logic above is working. once price hit moves past my target1, stoploss is set at avgprice+1. then when price moves to target2, stoploss is set at avgprice+target1. i can verify that in the output window and pending orders.

                  however, when price actually starts to retrace, these orders are amended. for example when price starts climbing down from the peak, instead of my stoploss being hit at avgprice+target1, it amends it back to the stoploss at avgprice+1.

                  any idea why?


                  Code:
                  5/9/2013 1:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:05:58 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:05:58 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:30:35 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:30:35 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:31:43 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:31:43 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  [B]5/9/2013 1:34:57 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False[/B]
                  5/9/2013 1:34:57 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1628 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                  5/9/2013 1:34:57 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:44:07 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:44:07 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:45:25 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:45:25 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:51:32 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  [B]5/9/2013 1:51:32 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False[/B]
                  [B]5/9/2013 1:54:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False[/B]
                  5/9/2013 1:54:21 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1627 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                  5/9/2013 1:54:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 1:58:09 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 1:58:09 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1628 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                  5/9/2013 1:58:09 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1628 Currency=0 Simulated=False
                  5/9/2013 2:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 2:04:46 PM Amended stop order: Order='05d0cd793c354e7f9bc2c2157b8c831b/Replay101' Name='Stop loss' State=Accepted Instrument='ES 09-13' Action=Sell Limit price=0 Stop price=1627 Quantity=1 Strategy='Reckotest1' Type=Stop Tif=Gtc Oco='33975169c32b457d8cd8cd8b3244bc03-18327' Filled=0 Fill price=0 Token='05d0cd793c354e7f9bc2c2157b8c831b' Gtd='12/1/2099 12:00:00 AM'
                  5/9/2013 2:04:46 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 2:09:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 2:09:21 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 2:09:56 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  5/9/2013 2:09:56 PM Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=1627 Currency=0 Simulated=False
                  It is doing what you asked it to do. You have to write logic to ensure that the StopLoss is not moved backwards when price retraces.
                  Last edited by koganam; 06-30-2013, 09:45 PM.

                  Comment


                    #10
                    Originally posted by koganam View Post
                    It is doing what you asked it to do. You have to write logic to ensure that the StopLoss is not moved backwards when price retraces.

                    hmm, gonna have to think about this one

                    Comment


                      #11
                      Originally posted by calhawk01 View Post
                      hmm, gonna have to think about this one
                      I believe that this thread covers exactly what you are trying to do. The final code is somewhere at the end.

                      ref: http://www.ninjatrader.com/support/f...30664#poststop

                      Comment


                        #12
                        Originally posted by koganam View Post
                        I believe that this thread covers exactly what you are trying to do. The final code is somewhere at the end.

                        ref: http://www.ninjatrader.com/support/f...30664#poststop
                        thank you my man, that worked

                        Comment


                          #13
                          Code:
                                  protected override void Initialize()
                                  {
                                      CalculateOnBarClose = true;
                                      SetTrailStop("", CalculationMode.Ticks, Stop/.25, false);
                                      SetProfitTarget("", CalculationMode.Ticks, (Profit/.25));
                                      TraceOrders = true;
                                  }
                          Code:
                                  protected override void OnBarUpdate()
                                  {
                          
                                              
                             
                                      if ((Position.MarketPosition == MarketPosition.Flat)
                                          && .................))
                                      {
                                          EnterLongLimit(DefaultQuantity, longbot, "");
                                      }
                                      
                                         if ((Position.MarketPosition == MarketPosition.Long)
                                          && Close[0] < CurrentDayOHL().CurrentOpen[0])
                          
                                          {        
                                            ExitLongStopLimit(CurrentDayOHL().CurrentOpen[0]-.25, CurrentDayOHL().CurrentOpen[0]);
                                          }
                          any one know why exitlongstoplimit is not being triggered? essentially i'm saying if i'm long and price is the opening price, exit 25 cents below

                          Comment


                            #14
                            even tried taking trailstop out of initialize:

                            Code:
                                    protected override void Initialize()
                                    {
                            
                                        CalculateOnBarClose = true;
                                        SetProfitTarget("", CalculationMode.Ticks, (Profit/.25));
                                        TraceOrders = true;
                                    }
                                    
                                    private void Manageorders()
                                    {
                                        if (Position.MarketPosition == MarketPosition.Long)
                                        {
                            
                                        if (Close[0] > Position.AvgPrice + 4)
                                            {
                                               SetTrailStop("", CalculationMode.Ticks, Stop/.25, false);
                                            }
                                        }
                                    }
                            
                                    private double stopPrice = 0;        
                                    /// <summary>
                                    /// Called on each bar update event (incoming tick)
                                    /// </summary>
                                    protected override void OnBarUpdate()
                                    {
                                        Manageorders();
                                                
                                        // Condition set 1
                                        if ((Position.MarketPosition == MarketPosition.Flat)
                                            &&........................))
                                        {
                                            EnterLongLimit(DefaultQuantity, longbot, "");
                                            stopPrice = CurrentDayOHL().CurrentOpen[0];
                                        }
                                        
                                              ExitLongStopLimit(stopPrice - (1 * TickSize), stopPrice);

                            Comment


                              #15
                              Originally posted by calhawk01 View Post
                              even tried taking trailstop out of initialize:

                              Code:
                                      protected override void Initialize()
                                      {
                              
                                          CalculateOnBarClose = true;
                                          SetProfitTarget("", CalculationMode.Ticks, (Profit/.25));
                                          TraceOrders = true;
                                      }
                                      
                                      private void Manageorders()
                                      {
                                          if (Position.MarketPosition == MarketPosition.Long)
                                          {
                              
                                          if (Close[0] > Position.AvgPrice + 4)
                                              {
                                                 SetTrailStop("", CalculationMode.Ticks, Stop/.25, false);
                                              }
                                          }
                                      }
                              
                                      private double stopPrice = 0;        
                                      /// <summary>
                                      /// Called on each bar update event (incoming tick)
                                      /// </summary>
                                      protected override void OnBarUpdate()
                                      {
                                          Manageorders();
                                                  
                                          // Condition set 1
                                          if ((Position.MarketPosition == MarketPosition.Flat)
                                              &&........................))
                                          {
                                              EnterLongLimit(DefaultQuantity, longbot, "");
                                              stopPrice = CurrentDayOHL().CurrentOpen[0];
                                          }
                                          
                                                ExitLongStopLimit(stopPrice - (1 * TickSize), stopPrice);
                              From the NT Help:
                              Methods that generate orders to exit a position will be ignored if:
                              • A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
                              • A position is open and an order submitted by a set method (SetStopLoss() for example) is active
                              You have TraceOrders on. The reason why your entry is being ignored should be stated in your log.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              648 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              369 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              108 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              572 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              573 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X