Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLong & ExitLongStop

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

    EnterLong & ExitLongStop

    I am using 3 long entries and 3 stops exits, I set a profit target in the Initialize section but nothing else

    EnterLong(Long1aQTY,"Long 1a");
    ExitLongStop(TRLLong1aseries[0],"Limit Exit Long 1a","Long 1a");

    Yet its being rejected

    The log screen is telling me there is no position to exit, but I have tied in the names?

    Where is my error, I understand

    14/05/2008 21:15:00 Entered internal PlaceOrder() method at 14/05/2008 21:15:00: BarsInProgress=0 Action=Buy OrderType=Market Quantity=10 LimitPrice=0 StopPrice=0 SignalName='Long 1a' FromEntrySignal=''

    14/05/2008 21:15:00 Entered internal PlaceOrder() method at 14/05/2008 21:15:00: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0 LimitPrice=1369.00 StopPrice=0 SignalName='Limit Exit Long 1a' FromEntrySignal='Long 1a'

    #2
    Tinkerz,

    Best is to simplify until the strategy is at a point where you understand its behavior, and then add additional complexity like scaling in with multiple signal rules.

    If you are at a point where you don't understand why a simple strategy does something, please post the strategy and steps to see the outcome you're seeing.

    As we mentioned in the other thread you participated in today -- this is not offered as a debugging service. Any code samples need to be concise with no more than the minimum required to show the item you're concerned about.

    If you are seeking a more personalized level of strategy debugging services, please consider contacting one of our 3rd party NinjaScript consultants:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I have simplifed the strategy to this

      EntriesPerDirection = 1;


      No initializing of stops

      1 profit target

      SetProfitTarget("Long 1a", CalculationMode.Ticks,10*4);

      1 entry and set the trailing stop

      if (Position.MarketPosition == MarketPosition.Flat)
      {
      EnterLong(Long1aQTY,"Long 1a");

      TRLLong1aseries[0] = (Close[0] - TRLLong1a);
      }

      move the trailing stop upwards only

      if (Position.MarketPosition == MarketPosition.Long)
      {

      if (Close[0] > TRLLong1aseries[1] && Close[1] > TRLLong1aseries[1])
      Print(TRLLong1aseries[0] +"//"+Close[0]+"//"+CurrentBar+"//"+ToDay(Time[0]));

      ExitLongLimit(TRLLong1aseries[0],"Limit Exit Long 1a","Long 1a");

      }

      Debug using the output with to check the limit order is lower that in entry
      1366.14228285447
      1385.5

      Yes its lower

      Definition:
      Generates a sell stop order to exit a long position.





      29/05/2008 21:15:00 Entered internal PlaceOrder() method at 29/05/2008 21:15:00: BarsInProgress=0 Action=Buy OrderType=Market Quantity=10 LimitPrice=0 StopPrice=0 SignalName='Long 1a' FromEntrySignal=''
      1366.14228285447//1400.5//103//20080530

      30/05/2008 21:15:00 Entered internal PlaceOrder() method at 30/05/2008 21:15:00: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=0 LimitPrice=1366.25 StopPrice=0 SignalName='Limit Exit Long 1a' FromEntrySignal='Long 1a'
      30/05/2008 21:15:00 Ignored PlaceOrder() method at 30/05/2008 21:15:00: Action=Sell OrderType=Limit Quantity=0 LimitPrice=1366.25 StopPrice=0 SignalName=Limit Exit Long 1a' FromEntrySignal='Long 1a' Reason='An Exit() method to submit an exit order has been ignore. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'

      **NT** An Exit() method to submit an exit order at '30/05/2008 21:15:00' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

      Comment


        #4
        Well its seems initalizing the profit target and ExitLongStop dont go together

        Why is that I read no text about a conflicting exits?

        Comment


          #5
          Thanks for the strategy and additional information, Tinkerz. Yes, you are running into internal order handling rules. You can read more about this here (bottom section):


          This is the one you're seeing:
          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
          Ryan M.NinjaTrader Customer Service

          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
          574 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X