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

Use of Historical property

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

    Use of Historical property

    Hello, i just want to clairfy what if any difference in the use of the Historical property available in Ninjascript.

    The 2 scenarios are :

    1. When Ninja first connects to the datafeed - days to load data is loaded first from Disk if available then from server if not ?

    2. When reloading ninjascript F5 or via apply in the indicator panel.

    It seems in the first case where i have checks for (!Historical) ie only real time data it is performing some processing of some lines being drawn in the logic of the indicator in the section of code if (!Historical) { } - when i actually do not want it to do anything. Is there anything different in the first case where the property is false when first loading the chart?

    For an F5 indicator reload the historical bars are not processed and lines do not appear which is the expected behaviour.

    Just wanted to check on any nuances of this.

    thanks

    #2
    Hello soulfx,

    Thank you for writing in.

    Historical data will be reloaded from the server upon connection. To prevent this from happening, you'll want to click on Tools -> Options -> Data tab and uncheck "Get data from server (if available)".

    The Historical property returns true if the script is running on historical bars. Otherwise, it will return false.

    For further clarification, your indicator is plotting on historical bars despite your logic to plot being contained within an if (!Historical) condition when connecting?

    Can you provide a sample script demonstrating this?
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ZacharyG View Post
      Hello soulfx,

      Thank you for writing in.

      Historical data will be reloaded from the server upon connection. To prevent this from happening, you'll want to click on Tools -> Options -> Data tab and uncheck "Get data from server (if available)".

      The Historical property returns true if the script is running on historical bars. Otherwise, it will return false.

      For further clarification, your indicator is plotting on historical bars despite your logic to plot being contained within an if (!Historical) condition when connecting?

      Can you provide a sample script demonstrating this?
      For further clarification, your indicator is plotting on historical bars despite your logic to plot being contained within an if (!Historical) condition when connecting?
      yes this what is happening ... i have 2 separate sections of code checking for (!Historical) and it is going into these sections to draw some lines and this code is only within these sections - and this is happening on connection not for F5. I presume multiple checks can be made within the onbarupdate or is only 1 check to Historical permitted?

      thanks

      Comment


        #4
        Hello soulfx,

        You can check for Historical multiple times if desired.

        Can you please provide your script so I may take a look at it?
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          it is a long script ... to run you need 3rd party DLL library ...
          so i guess i need to trim down and localise it with a similar structure?
          should i do this first ... it is odd
          before doing so is there any other check i can put in place to know when loading from a connection or like in strategies when the first real time bar is .... that would help

          Comment


            #6
            Hello soulfx,

            Please provide a simplified sample of your script that can demonstrate this behavior.

            The first real-time bar would have Historical return false.
            Zachary G.NinjaTrader Customer Service

            Comment


              #7
              Hello there i have submitted a support request with the attached script and some notes on the processing outcome
              thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Tim-c, Today, 02:10 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              2 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              50 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              10 responses
              401 views
              1 like
              Last Post beobast
              by beobast
               
              Started by lorem, Yesterday, 09:18 AM
              5 responses
              25 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X