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 benmarkal, Yesterday, 12:52 PM
              3 responses
              23 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by helpwanted, Today, 03:06 AM
              1 response
              19 views
              0 likes
              Last Post sarafuenonly123  
              Started by Brevo, Today, 01:45 AM
              0 responses
              11 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              244 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              388 views
              1 like
              Last Post Gavini
              by Gavini
               
              Working...
              X