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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X