Announcement

Collapse
No announcement yet.

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.

    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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      29 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      46 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X