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

Intrabar Price Data Access

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

    Intrabar Price Data Access

    grande846 did you get this to work? I am a newbie and am stuck here as well.

    NinjaTrader_ChrisL - I have looked at the picture that you posted (the one at clauber.tinytake) but I still cannot get my strategy to execute correctly. Am I reading that picture correctly when I think of it this way -- "the close of the current bar + 1 tick is greater than the high of one bar ago." And then, if I have my strategy set to calculate by the tick, then am I to read that as the "close of the current bar" is actually the current price since the current bar isn't closed yet? Am I following that correctly?

    #2
    Hello Jim, thanks for your post.

    I moved this post from the old thread here:
    Regarding using STRATEGY BUILDER (I don't know C# at all), how do I script the condition for triggering a long entry when a bar breaks above any previous bar high after a series of lower high correction bars? Let me phrase it again if you don't follow, in the attached picture, I am looking for long since market forms a swing


    If the strategy is running OnEachTick then the Close[0] price will be the last seen price from the bar. Your assumption: "close of the current bar" is actually the current price since the current bar isn't closed yet?" is correct.

    If you are seeing incorrect behavior during the strategy backtest, you must enable Tick Replay to get the intrabar price movement historicaly:


    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply NinjaTrader_ChrisL . I have enabled tick replay as you suggested but it still isn't working correctly. Is this what you would expect to see?
      Click image for larger version

Name:	image_2021-02-08_090100.png
Views:	167
Size:	7.6 KB
ID:	1140638

      Comment


        #4
        Hello Jim, thanks for your reply.

        How exactly is it not working correctly? Is the strategy missing the signal coming from this condition or are you getting too many signals from this condition? I set up the same thing and added debugging techniques like drawing a dot on the signal and also Printing the price data when a signal shows up e.g.



        Doing this will be the best way to resolve issues with custom strategies made within the builder. You can see the out put from the Print statement by going to New> NinjaScript Output.

        I look forward to hearing of your results.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          I am over-looking something and I am sure it is a newbie issue!

          Here is what I am doing, I open my Strategy by clicking New, Strategy Builder, and choosing my target strategy. I have edited it to look like this:

          Click image for larger version

Name:	image_2021-02-08_112302.png
Views:	152
Size:	16.3 KB
ID:	1140681


          I then go back to the Main Window and disable the strategy and then re-enable it so that it refreshes. When I look at the chart, I see this:

          Click image for larger version

Name:	image_2021-02-08_112106.png
Views:	209
Size:	14.8 KB
ID:	1140680
          It appears to be firing because there was indeed a crossover of the AVG line by the MACD line on the previous bar. But I'd like it to wait until the current price (on the second bar) extends beyond the high of the previous bar (the first bar). In this example, it appears that the entry was made to soon, at the open of the second bar. The Ninjascript Output is not showing my prints when I do it this way - do I need to be doing this in a replay connection for it to show correctly or did I enter it incorrectly?

          Comment


            #6
            Hello Jim, thanks for your reply.

            Please do a test in the Playback connection and see if you get a different result than on the historical backtest. Another setting to note is the Order Fill Resolution from the Strategy settings. Set this to "High" and select 1 Tick for the series to use. This will fill the orders upon a 1 tick series for more accurate historical intrabar fills. This setting provides a higher resolution series for the Historical Backfill algorithm to use instead of the primary chart series.

            The output window should be printing something if the condition became true. I attached my test script for you to try out on your system. This strategy produces output. To import it go to Tools>Import>Ninjascript Addon.

            I look forward to assisting.
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Blaze212, 07-07-2024, 08:58 PM
            6 responses
            34 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by mmenigma, Yesterday, 08:57 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Daveman0, 06-01-2022, 09:37 AM
            12 responses
            543 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by agalindoc, 07-09-2024, 03:18 PM
            3 responses
            42 views
            0 likes
            Last Post agalindoc  
            Started by Kdevineni, Yesterday, 05:32 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X