• 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

Best way to program entry

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

    Best way to program entry

    Here is my dilemma.

    If I have calculate on bar close = true, then my indicators work and calculate correctly, but then I'm not entering the trade until the bar closes, which is not my goal.

    If I have calculate on bar close = false, then my indicators don't calculate the way I want them to, but my entry is perfect.

    Essentially I am calculating a value that is below the current market price (if going short) or above the current market price (if going long). And I want the order to trigger as soon as that price is hit.

    What is the best way to code this? I am currently using a buystop/sellstop order, but that order is being updated everytick and flooding my output window. I'm guessing there is a more efficient way to code this.

    Thanks,

    Rich

    #2
    Hello,

    Thank you for your forum post.

    If you need your orders to be on a tick by tick bases but want your indicator values to update on a bar by bar bases this is possible.

    You will want to use FirstTickOfBar and put your indicator update logic in here.then update your orders in OnBarUpdate with COBC = False.

    The best of both worlds

    http://www.ninjatrader-support.com/H...TickOfBar.html


    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      I knew it could be done. Thanks!!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GMiller64, Today, 01:13 PM
      3 responses
      7 views
      0 likes
      Last Post GMiller64  
      Started by itrader46, Today, 12:51 PM
      4 responses
      33 views
      0 likes
      Last Post itrader46  
      Started by hemlock, Today, 11:45 AM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by gbulle, Today, 11:31 AM
      2 responses
      8 views
      0 likes
      Last Post gbulle
      by gbulle
       
      Started by JPPoulin, Today, 10:43 AM
      6 responses
      23 views
      0 likes
      Last Post JPPoulin  
      Working...
      X