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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X