Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CreateOrder vs EnterLong... with SetStopLoss&SetProfitTarget

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

    CreateOrder vs EnterLong... with SetStopLoss&SetProfitTarget

    Hi,

    I am trying to understand the benefits/limitations of using either way including the ability to run Strategy Analyzer

    I see the help of each, but I can't find the benefits/limitations or reasoning to use what.

    #2
    Hello Shai Samuel,

    Thanks for your post.

    The EnterLong() method is a managed approach order method that tells your NinjaScript strategy to submit a long entry order to the market.

    <Account>.CreateOrder() tells your script to submit an order to the account specified in the script. This is an add-on approach method that could be used in a NinjaScript strategy or indicator. Further, if you are tracking multiple accounts in a script, this method would allow you to submit orders to multiple accounts from a single script.

    If you are creating a strategy that does not require that you submit an order to a specific account, you may use the EnterLong() method with SetStopLoss()/SetProfitTarget().

    See the help guide documentation below.

    EnterLong(): https://ninjatrader.com/support/help.../enterlong.htm
    Managed Approach: https://ninjatrader.com/support/help...d_approach.htm
    Account: https://ninjatrader.com/support/help...ount_class.htm
    <Account>.CreateOrder(): https://ninjatrader.com/support/help...reateorder.htm

    Let me know if I may assist further.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thank you Brandon for your clear response. I may want to use multiple accounts, so this makes sense.

      As far as backtesting, when using a single account (possibly sim101), would CreateOrder approach work for backtesting?

      Comment


        #4
        Hello Shai Samuel,

        Thanks for your note.

        Yes, CreateOrder() could be used for submitting orders to a single account. However, the Strategy Analyzer does not have a specific account for backtesting scripts so this means you wouldn't be able to submit orders to a specified account. Instead, you could use the Playback connection to test a strategy that uses CreateOrder().

        If you want to be able to backtest a strategy in the Strategy Analyzer, EnterLong()/EnterShort() should be used, or SubmitOrderUnmanaged() if you are using the Unmanaged Approach.

        Playback: https://ninjatrader.com/support/help...htsub=playback

        Let me know if you have further questions on this topic.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        55 views
        0 likes
        Last Post CarlTrading  
        Working...
        X