Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit target and stop order for the next days

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

    Profit target and stop order for the next days

    Dear support, I need you help.

    I want to enter the position (3 lots) and send two profit targets and one stop loss.
    But I want to save these orders (profit target and stop loss) during many days.

    So:
    1. how will behave platform if I turn off the computer? will my position and orders be saved?
    If not, how to save them or may be simulate?
    2. When I turn on my computer next day, how to get previous entry price.

    Thank you for answer in advance.

    #2
    Hello AlexFdv,

    Thank you for your post.

    The orders and positions will be submitted to the broker and then the exchange and when you restart NinjaTrader you should receive an update for these positions and orders when connected to your brokerage technology. Additional information on where your orders reside can be found at the following link: http://www.ninjatrader.com/support/f...ead.php?t=5349

    However, the automated strategy in NinjaTrader will be disabled when you shut down NinjaTrader and when you restart NinjaTrader and then enable the strategy again it will not pick up the previous orders and positions. So if you wish for the strategy to continue to manage the orders and positions you will need to keep NinjaTrader running. For information on working with automated strategies please visit the following link: http://www.ninjatrader.com/support/h...strategies.htm

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

    Comment


      #3
      One more: so if I won't be able to manage orders after restarting my computer, how to reduce number of StopOrders lots after first profit target is filled?

      i.g. I send 2 profit targets and 1 stop loss. I restart my computer, but orders are still working.

      profitTargets_.Add(ExitLongLimit(0, true, 1, limitPrice1, "ExitLongLimi1", "EntryLong"));
      profitTargets_.Add(ExitLongLimit(0, true, 2, limitPrice2, "ExitLongLimi2", "EntryLong"));
      exitStopOrderId_ = ExitLongStop(0, true, 3, stopPrice, "ExitLongStop", "EntryLong");

      1. When first profit target is filled, stop order lots should be reduced.
      2. When stop order is filled, my profit orders should be cancelled.

      Comment


        #4
        Hello AlexFdv,

        Thank you for your response.

        The strategy would need to be running to manage the orders. so you would need your own calculations to determine that the profit targets in this case were filled to resubmit the stop loss with a new quantity.

        I recommend taking a look into the OnExecution() method for this item: http://www.ninjatrader.com/support/h...nexecution.htm

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

        Comment


          #5
          Patrick,

          One moment: if I submit orders and enter the position
          EnterLong("EnterLong")

          and send profit targets after position openning
          ExitLongLimit(0, true, 1, profit1, "ExitLongLimi1", "EntryLong");
          ExitLongLimit(0, true, 2, profit2, "ExitLongLimi2", "EntryLong")
          ;

          These profit targets are submitted to the broker and then the exchange. After my NinjaTrader restart they are still working, and I can't manage them. BUT: is it possible to cancel these working profit target orders using command CancelAllOrders(true, true)? Because I want to revert the position and to do that I need to cancel all previous orders for sending new Profit Targets.

          Comment


            #6
            Hello AlexFdv,

            Thank you for your response.

            If NinjaTrader is restarted the strategy will not be able to manage the previous orders. You will need to manually cancel these orders before or after you restart NinjaTrader.

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

            Comment


              #7
              Patrick,

              Sorry for annoying
              If I restart my Ninjatrader, will I get last entry price (filled price) using Positon.AvgPrice?

              Comment


                #8
                Hello AlexFdv,

                Thank you for your response.

                Unfortunately, you will not get any values for previous positions, orders, or the account position.

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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by alifarahani, Today, 09:40 AM
                6 responses
                36 views
                0 likes
                Last Post alifarahani  
                Started by Waxavi, Today, 02:10 AM
                1 response
                17 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Kaledus, Today, 01:29 PM
                5 responses
                14 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Waxavi, Today, 02:00 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by gentlebenthebear, Today, 01:30 AM
                3 responses
                17 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X