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

Range bars, strategy and close on bar

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

    Range bars, strategy and close on bar

    Hi,

    I've got some screwy looking behaviour, but maybe I just don't understand how the chart is supposed to work. I have a Range period selected, I have a strategy which plots signal markers on the chart, and the strategy is set to calc on end on bar close.

    I noticed that once the bar has achieved the full range (eg. a 4 tick range bar gets to 4 price levels) but has yet to actually close (meaning a new bar has not yet started) the signal marker from the the strategy plots on the chart.

    This causes major problems. For example, in the case I observed this morning, I had a short signal plot once the full range of the bar plotted, but then the bar went from being at the low tick to the high tick, exited through the high, and thus created a new bar. But, I was left with the short signal. Once I refreshed the NinjaScript, the marker from the Strategy, correctly, no long showed.

    #2
    Hello coolmoss,
    Thanks for writing in and I am happy to assist you.

    In case of a range bar a new bar will be formed only if a new bar crosses the range high/low. Simply touching the high or low of the range do not mean a new bar will be formed. A bar can hit the low and from there can move in the opposite direction and crosses the high to form a new bar.

    A bar closing event is basically equals to the opening event of the next bar.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      You're description fits my understanding of how it should work, but this is not how Ninja is functioning. As I stated above, I have a strategy which executed an action before the bar closes, yet the strategy was set to calculate on bar close.

      What might be wrong here?

      Thanks.

      Edit:

      I am noticing some strange things in the Orders tab. Watching live data, my signal plots, the correct orders are submitted (based on the Orders tab), and price trades well through the Stop price on the order, but the order is never actually filled (on sim acct). If I refresh to chart, then it shows up historically.

      I can't imagine what I'm doing wrong in the setup, it's not that hard
      Last edited by coolmoss; 03-05-2012, 11:41 AM.

      Comment


        #4
        Hello coolmoss,
        Is your strategy calling any indicator which is explicitly assigned as CalculateOnBarClose = false?

        Are you submitting limit order or market order?

        Can you provide us with a sample code which reproduces the issue? You can send your code to support[AT]ninjatrader[DOT]com and please write Attn:Joydeep in the subject line of the email and please do give a reference of this thread in the body of the email.

        I look forward to assisting you further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I feel like an idiot. 30 lashes to coolmoss. Let say my alter-ego changed the strategy to calc on close to False. I just don't know how I could have done that.

          My bad, but thanks for such great support.

          Comment


            #6
            Hello coolmoss,
            Glad you could found a solution.
            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sightcareclickhere, Today, 01:55 PM
            0 responses
            1 view
            0 likes
            Last Post sightcareclickhere  
            Started by Mindset, 05-06-2023, 09:03 PM
            9 responses
            258 views
            0 likes
            Last Post ender_wiggum  
            Started by Mizzouman1, Today, 07:35 AM
            4 responses
            18 views
            0 likes
            Last Post Mizzouman1  
            Started by philmg, Today, 01:17 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by cre8able, Today, 01:01 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X