Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple entries using current bar data

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

    multiple entries using current bar data

    I just started to learn Ninja using simulated data feed. I wrote some ATI strategies using point and click Strategy Wizard with Condition Builder. All of them operate fine until:

    Example: strategy condition is to buy when, lets say, "ask is below lower Bollinger Band by 2 ticks" and keep adding to the position every time if/when the condition is met in the future preferably at lower price than the last buy. Never mind the exit part, I got that figured out and it works fine.

    I changed 1 to 10 in "order handling" "entries per direction" expecting the strategy will do up to 10 buys. It works fine when I have "calculate on bar close" checked in the Strategy Wizard. But since the fill occurs on the next bar it may be at much higher price, of course, than "below lower BBand".

    So, to improve fill price, I click "calculate on bar close" OFF, and use "current bar data". Now the fills are "below lower BBand", BUT since "current bar data" uses every incoming tick within the bar, when strategy conditions are met for the 1st time, it does "10 buys" all at the same time and at the same price and within the same bar, and that`s that. That`s not what I had in mind.
    I can`t figure out how to tell the strategy to do just "1 buy at a time", saving the other 9 (or whatever number consequently may be left in the future ) for later. I tried everything I can think of, no luck.
    I read the help, didn`t find anything on "multiple entries using current bar data".
    I don`t know anything about code or script or programming. Do I have to?

    thank you

    #2
    lesbud, there is probably some way to "fool" the strategy wizard into doing this, but that could be just as difficult as writing the code for it.

    Basically, you'll need some sort of counter that counts the number of bars that go by and makes sure you only enter once per bar. Adding in the CalculateOnBarClose = false will still require that some calculations are only done once per bar. To get an overview of how do run certain calculations only once per bar, this reference sample can help get you started.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you,

      I thought that may be the case and read "bars objects, bars array" before posting my question. I have no idea how to implement/write it into my strategy. I hardly understand what it said. I have a lot to learn. Or find a way around it.
      Such as, use "calculate on bar close" instead. Change ask to close in the conditions, and then in the actions enter a buy with a limit order 2 ticks below last bar close (or the other way for shorts). That way I`d be filled lower than I originally had in mind (and ONE time per bar). That`s providing the market will fall additional 2 ticks. If not, I`d miss the entry/trade all together. I`ll experiment, see what I can come up with.

      Thank you for your help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      630 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      566 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X