• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie Question Do I close a position before trying to place a new order?

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

    Newbie Question Do I close a position before trying to place a new order?

    I'm creating my first Strategy code via the wizard and I know that I don't know what I'm doing yet.
    I want to go long when certain conditions are met and short when other conditions are met. The conditions are a crossover of the EMA indicator line.
    Basically this is a signal to signal strategy. Go long until you close and go short until you close and go long again.

    Question: Do I "Exit" the short before taking the 1st long and vice versa do I "exit" the long before taking the 1st short?

    I've got more questions but that is one to get things going on this topic, remember I'm a newbie so please, be gentle!
    Ronnie

    #2
    Hello RonnieB,

    Thanks for your post.

    With reference to "Do I close a position before trying to place a new order?". If you are in a position already (for example Long) and your strategy says to go short, entering a short order will automatically create two short orders, the first is used to close the existing long position and it will show on the chart named as "Close position" and the 2nd short order will leave you in a short position. If you are in a flat position then a short order will only place the 1 order to leave you in the short position. In summary, all entry orders will automatically close an existing position in the opposite direction.

    You can exit a position before going in the opposite direction if you wish. For example you want to enter long on a crossover and decide to set a specific profit target and stop loss. In this case you go long on the crossover and if the profit target or stop are hit then you would be in a flat position Both the Profit target and stop are exit orders.

    I suggest reading the help guides section on the "managed approach" which will govern most strategies and puts some limitations in place to reduce unwanted positions: https://ninjatrader.com/support/help...d_approach.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks PaulH, I have removed the 'close order' code and will just let the system do its own cancellation of an existing order and place the new one via the "Managed Approach" - thanks as well for the link, that helps. I've compiled the script and have it working in SIM to see how it performs. Much appreciated!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cliffhu, Today, 10:59 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by Slaywer, Today, 05:17 AM
      2 responses
      13 views
      0 likes
      Last Post Slaywer
      by Slaywer
       
      Started by billythekid72, Today, 10:55 AM
      2 responses
      10 views
      0 likes
      Last Post billythekid72  
      Started by memonolog, Today, 10:49 AM
      5 responses
      9 views
      0 likes
      Last Post memonolog  
      Started by stjames1745, Today, 10:39 AM
      2 responses
      10 views
      0 likes
      Last Post stjames1745  
      Working...
      X