• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 nepenthean, Today, 12:36 PM
              0 responses
              3 views
              0 likes
              Last Post nepenthean  
              Started by sun0781, Yesterday, 05:02 PM
              1 response
              19 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by Emma1, Today, 12:14 PM
              0 responses
              2 views
              0 likes
              Last Post Emma1
              by Emma1
               
              Started by Hanstanz, Today, 04:44 AM
              1 response
              17 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by Newtrader101, Today, 10:31 AM
              0 responses
              8 views
              0 likes
              Last Post Newtrader101  
              Working...
              X