Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sliding orders

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

    Sliding orders

    Hello,

    I am running a very basic strategy. A signal generates an order. However, the order is only valid for one bar (the bar after signal) at one level.

    Ideally, I would like the order to be valid for a number of bars (say 3) and automatically adjust at every bar (eg, trailing the moving average). Is that possible and if so, how?

    Thanks,

    N

    #2
    Hello,

    Thanks for the forum post and welcome to the NinjaTrader forums!

    This is possible and is how limit orders in NinjaTrader work by default.

    EnterLongLimit() needs to be submitted each bar with the price of the order for that bar. So change the order price the order will update next bar when you call this. Also, if you do not call this then cancels the order.



    Let me know if I can be of further assistance.

    Comment


      #3
      Sliding orders

      It seems that the ability to slide the orders as described is only available when unlocking the code rather than writing the ninja script using the wizard. Is that correct?
      N

      Comment


        #4
        nkonialidis, can you please clarify what you mean by sliding orders? Non market orders would expire at the end of the bar they were submitted on per default in NinjaScript.

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Sliding orders cont'd

          Let's just imagine that once a condition happens (let's say two moving averages cross), I want a buy order to be active on a third moving average. In the wizard, if I put as one of the actions to be a limit order, that order will only be active at that level and for one bar. I would like the order to stay on that moving average for a number of bars (and thus "slide")

          Comment


            #6
            Hello,

            No need to unlock the code to do this. This is possible in the strategy wizard. Simply call EnterLongLimit with the price set as the variable price will do the trick for you. The order will update for each bar is not filled to move the order to this price.

            I look forward to assisting you further.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Skifree, Today, 03:41 AM
            0 responses
            1 view
            0 likes
            Last Post Skifree
            by Skifree
             
            Started by usazencort, Today, 01:16 AM
            0 responses
            1 view
            0 likes
            Last Post usazencort  
            Started by kaywai, 09-01-2023, 08:44 PM
            5 responses
            603 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            6 responses
            23 views
            0 likes
            Last Post xiinteractive  
            Started by Pattontje, Yesterday, 02:10 PM
            2 responses
            22 views
            0 likes
            Last Post Pattontje  
            Working...
            X