Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Clarification needed on order submission

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

    Clarification needed on order submission

    When using SetStopLoss and SetProfitTarget in the Initialize section of a strategy then entering a position using EnterLong/EnterShort, are the stop loss and target submitted simultaneously or separately?

    I ask because I've seen on a few occasions (on a 6 Range chart) as many as 80 candles being generated in 1 second. If the target was entered separately from the stop loss it seems to me that the price could be past my stop before the stop loss was executed.

    #2
    Hello bassmanpete,

    Thank you for your post.

    The Stop Loss and Profit Target are submitted simultaneously. You can check your Log tab when the Stop Loss and Profit Target is submitted to see if there is any delay in one of the orders being submitted.

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

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello bassmanpete,

      Thank you for your post.

      The Stop Loss and Profit Target are submitted simultaneously. You can check your Log tab when the Stop Loss and Profit Target is submitted to see if there is any delay in one of the orders being submitted.

      Please let me know if I may be of further assistance.
      Thanks for your reply Patrick. Looking at the log, it appears that the stop loss is processed first. Would that be because we have it declared first in the strategy as shown below or is it automatically processed that way?

      SetStopLoss("", CalculationMode.Ticks, stoploss, false);
      SetProfitTarget("", CalculationMode.Ticks, target);

      Whatever the case may be, and just to be on the safe side, is it possible to get the entry price of a trade, compare it to the current price and exit the trade if my stop has been passed?

      Comment


        #4
        Originally posted by bassmanpete View Post
        Thanks for your reply Patrick. Looking at the log, it appears that the stop loss is processed first. Would that be because we have it declared first in the strategy as shown below or is it automatically processed that way?

        SetStopLoss("", CalculationMode.Ticks, stoploss, false);
        SetProfitTarget("", CalculationMode.Ticks, target);

        Whatever the case may be, and just to be on the safe side, is it possible to get the entry price of a trade, compare it to the current price and exit the trade if my stop has been passed?
        That is what will happen anyway: if your Stop has been violated when your SetStop() is placed, then, per normal, the order will be executed immediately at market.

        Of course, if you insist, you can always do the calculation that you outine and submit an exit order in OnMarketData().

        Comment


          #5
          Hello bassmanpete,

          Thank you for your response.

          No matter the order in the code in your code it appears the Stop Loss will be listed first before the Profit Target in the logs.

          Comment


            #6
            Originally posted by koganam View Post
            That is what will happen anyway: if your Stop has been violated when your SetStop() is placed, then, per normal, the order will be executed immediately at market.

            Of course, if you insist, you can always do the calculation that you outine and submit an exit order in OnMarketData().
            So it's not possible for my stop to be bypassed and to incur an unlimited loss?

            Comment


              #7
              Originally posted by bassmanpete View Post
              So it's not possible for my stop to be bypassed and to incur an unlimited loss?
              We are talking about multiple computers linked by a network that was deliberately designed to be unreliable, so that it cannot be taken down, so we cannot say: "it's not possible". However, barring unforeseen issues with the hardware somewhere in the chain, a logic failure is unlikely, so SetStop() will trigger an exit one way or another: immediate if the conditions that would otherwise trigger it have already been met; delayed until such time as exit conditions are met otherwise.

              Comment


                #8
                Originally posted by bassmanpete View Post
                When using SetStopLoss and SetProfitTarget in the Initialize section of a strategy then entering a position using EnterLong/EnterShort, are the stop loss and target submitted simultaneously or separately?

                I ask because I've seen on a few occasions (on a 6 Range chart) as many as 80 candles being generated in 1 second. If the target was entered separately from the stop loss it seems to me that the price could be past my stop before the stop loss was executed.
                I tried to enter a market order transaction once during 8:30am EST news event on a 4 range chart - ORDER WAS REJECTED on ES....

                zenfire

                Comment


                  #9
                  Hello sledge,

                  Thank you for your post.

                  Do you see the rejection message in your Log tab of the NinjaTrader Control Center?
                  If so, please detail what this message states.

                  If not, please send me your log and trace files for today so that I may look into what occurred.
                  You can do this by going to the Control Center-> Help-> Mail to Support.

                  Please put 'ATTN: Patrick - 835218' in the subject line and reference this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=57476

                  I look forward to your response.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by lightsun47, Today, 03:51 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post lightsun47  
                  Started by 00nevest, Today, 02:27 PM
                  1 response
                  8 views
                  0 likes
                  Last Post 00nevest  
                  Started by futtrader, 04-21-2024, 01:50 AM
                  4 responses
                  44 views
                  0 likes
                  Last Post futtrader  
                  Started by Option Whisperer, Today, 09:55 AM
                  1 response
                  13 views
                  0 likes
                  Last Post bltdavid  
                  Started by port119, Today, 02:43 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post port119
                  by port119
                   
                  Working...
                  X