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

Advancing the active or current bar

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

    Advancing the active or current bar

    In my strategy, I am using <IsFirstTickOfBar> when making an entry but there are times that I would like to make the entry on the next bar. Is there a way to advance that bar, I tried nesting <IsFirstTickOfBar> but it did not work for me.

    #2
    Hello galsermil,

    You cannot advance the data or manipulate the data in any way, the way your script processes is a result of how it processes the bar data and incoming data.

    You would have to make your own logic which handles that situation. A simple way would be to use a bool variable. At the time when you see the entry should be submitted you could set the variable to true, on the next bar if the variable is true submit the order. You can also use more complex ways like storing the CurrentBar to check if a number of bars elapsed.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you. I think I have myself between a rock and a hard place because I am using <IsFirstTickOfBar> in order to get my entry as close to the Open of the bar as possible but the signal to not use that bar is produced during that bar, usually quite early but not always. I suppose that I will have to find my warning at bar[1] or not at all..

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Ashkam, 04-29-2024, 09:28 AM
      4 responses
      43 views
      0 likes
      Last Post Ashkam
      by Ashkam
       
      Started by nightstalker, Yesterday, 02:05 PM
      1 response
      29 views
      0 likes
      Last Post NinjaTrader_Eduardo  
      Started by dcriador, Today, 02:09 PM
      0 responses
      5 views
      0 likes
      Last Post dcriador  
      Started by nicthe, Today, 07:38 AM
      4 responses
      21 views
      0 likes
      Last Post bltdavid  
      Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
      30 responses
      98 views
      0 likes
      Last Post cmtjoancolmenero  
      Working...
      X