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

Screen capture historic 5min bars chart

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

    Screen capture historic 5min bars chart

    Hello, I wrote an indicator that captures the chart OnBarUpdate where IsFirstTickOfBar is true. This way I get a chart capture every time a bar closes and a new bar is started. I have tested this to work almost identically if the Calculate property of the indicator is either On Bar Close, On Tick, or On Price Change. During live data this works as expected and mentioned above. I also have a check there where I don't run the image capture if State == State.Historical, because I noticed this gets called a whole lot when the chart is initializing to build the past few bars as needed.

    The end goal here is that I want to capture these images for the past 2 years. What is the best way to do this? Knowing that the image capture doesn't work if the chart isn't updated. I am wondering if there is a way I can run market replay for the past 2 years, but that is too time consuming to run tick by tick when all I really need it 5 minute bars. Is there a way I can run market replay with 5 minute fidelity? Or what other options do I have? I was thinking I could load the chart a few month at a time and code a scroll/capture routine but NT8 doesn't support bar scrolling programmatically. What can I do? Thanks.

    #2
    Hello arabisoft, thanks for your post.

    You would need to use the Playback connection to do this. Since the Playback data we provide does not go back over 2 years, you will need to download historical data while connected to your data provider. This can be done from the Tools>Historical data menu.

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

    Comment


      #3
      Hi Chris, thank you. A few questions
      1- how far back does your payback data go for NQ/ES?
      2- if I were to download the data, does it have to be tick/payback data or can it be just backtest second/minute data?
      3- if it isn't playback data, and just backtest minute data instead, will I be able to control the rate at which it's progressing?

      Thanks.

      Comment


        #4
        Hello, thanks for your reply.

        1. We record popular futures and forex markets up to 90 days back. You can record incoming data into your platform as well.

        2. You do need historical tick data for replay to work on historical playback mode.

        3. Tick data is required to use historical playback, minute data and above can not be replayed, but can be backtested in the Strategy Analyzer.

        Best regards,
        -ChrisL

        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Ok, thanks. A couple more.
          1- Can I download tick data and use it for replay? Will replay work with regular tick data or do I have to download ask/bid ticks as well?

          2- programmatically, is there a way to force a chart render during historical state of runtime? Is there a command in NT8 library that would force the chart to update?

          Thanks.
          M

          Comment


            #6
            Hello, thanks for your reply.

            1. When you are connected to your data provider, go to Tools>Historical data load tab. From there you can download historical data from your data provider. The playback system will only use the last tick series to replay the data. Level 3 data will not be available, however, you can use Tick Replay to determine the best bid or ask at the time a tick enters the system. See the example titled "Accessing the current best bid and ask at the time of a trade":

            https://ninjatrader.com/support/help...ick_replay.htm

            2. NinjaTrader checks to see if OnRender should be called every 250ms. There is the ForceRefresh method to make the interval reset and make the OnRender method run as soon as possible. Now, this is different than making the chart update. If you want to force OnBarUpdate to be called, use the Update() method. Whether these methods are useful depends highly on what exactly you are doing in the script. E.g. If I ran a script that runs OnEachTick and it adds something like an SMA, I would want to call Update on the SMA object so I know the SMA object is getting updated in sync with my host indicator.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              This is good information to go on. Thank you very much for your help.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ETFVoyageur, 05-07-2024, 07:05 PM
              17 responses
              133 views
              0 likes
              Last Post ETFVoyageur  
              Started by ETFVoyageur, Today, 10:13 PM
              1 response
              7 views
              0 likes
              Last Post ETFVoyageur  
              Started by somethingcomplex, Today, 10:36 PM
              0 responses
              7 views
              0 likes
              Last Post somethingcomplex  
              Started by sofortune, Yesterday, 10:28 AM
              5 responses
              22 views
              0 likes
              Last Post sofortune  
              Started by guyonabuffalo, Today, 10:01 PM
              0 responses
              4 views
              0 likes
              Last Post guyonabuffalo  
              Working...
              X