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

2 opposite orders on the same minute

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

    2 opposite orders on the same minute

    Hello
    what would be the code of a sell order followed by a buy order if a condition is met, please?

    I mean, if I'm already on a short position and a reversal happen and I would like to cover my short position and go long right away. Of course, I dont want to wait the following minute to send my buy order,, if it's possible, based on a strategy refreshed every closing bars.

    Thanks a lot.

    #2
    Hi Bricolico, thanks for your question.

    In the managed approach reversals can be done automatically. For an example look at the SampleMACrossover strategy. It reads the long and short condition. So if the strategy is already long and it gets the sell short signal, it calls SellShort(), when that happens the long position is closed out and the short position is entered.

    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the follow up.

      Seems pretty simple to me. Will try this tomorrow.

      As always, thanks for this nice answer. :-)

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by TraderG23, 12-08-2023, 07:56 AM
      10 responses
      397 views
      1 like
      Last Post beobast
      by beobast
       
      Started by lorem, Yesterday, 09:18 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by WHICKED, Today, 12:56 PM
      2 responses
      15 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Felix Reichert, Today, 02:12 PM
      0 responses
      4 views
      0 likes
      Last Post Felix Reichert  
      Started by Tim-c, Today, 02:10 PM
      0 responses
      6 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Working...
      X