Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter Limit Orders at a given moving average

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

    Enter Limit Orders at a given moving average

    I've created a simple strategy using the strategy wizard. I'm trying to figure out how to enter a Long (or short) order at a given EMA once my condition is triggered.

    Is it not possible to use an indicator such as an EMA as the value where to place my limit order? Again, this is using the strategy wizard.

    Thanks for the help!

    #2
    pev11, whichb exact errors / issues are you getting? Do you see the condition hit but an order not filled then? For the limit orders generated via the wizard you would need to keep in mind that they would expire on the bar you've placed them on, meaning they would not persist to be filled a few bars later then if price would retrace for example. You can resubmit them every bar, or set the order to be liveUntilCancelled directly through coding -

    Comment


      #3
      Thanks for the response. It appears that is the primary problem (order cancelled after first bar).
      What I need is for the order to remain live until either:
      A. The order gets hit
      B. My condition triggers a reversal (order is cancelled and a new order is entered)
      C. Strategy ends at a specified time

      I guess I will have to edit the code manually to accomplish these parameters? Any tips?

      Thanks again!

      Comment


        #4
        Correct, to leave the order working you would want to use the more advanced overload to set it liveUntilCancelled.

        If you wish to reverse then CancelOrder() as needed and place the new needed order, this sample shows how to work with the custom cancelleation - http://www.ninjatrader.com/support/f...ad.php?t=18890

        For a time filter please check into - http://www.ninjatrader.com/support/f...ead.php?t=3226

        You can then simply CancelOrder at a specific time as well to ensure no later entry is taken.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, Yesterday, 04:31 AM
        0 responses
        33 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        285 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        91 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X