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

OHLC times

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

    OHLC times

    In NT7, is it possible to get the times at which the last bar made its open, high, low, and close? How about those times N bars back? Or an average of, say, C - O? Once I have these numbers, there are many studies I would like to make, but so far I can't get by this first step. It seems there must be a way to do it in C#, but that is even farther out of this non-coder's reach.

    Thanks.

    #2
    Hello PBreen,
    Thanks for your post.

    There would not be a simple NinjaScript method or property to give you the time of the OHLC. You would need to do this with your won custom logic. You can get the timestamp of the current bar using Time[0]. You can get an average of the current Close-Open by doing (Close[0]-Open[0])/2

    Perhaps using multiple time frames could be helpful here. Either way I suggest familiarizing yourself with the basic NinjaScript items as you have a few concepts that need to be implemented here. Let me know if you would like some training materials.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development team to follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Many thanks. I thought that was the case, but it seemed worth making sure I had not missed something.

      It's not the average values I need, thanks, but Time[C[n]] - Time[O[n]]. Looks like I will have to learn C# coding or buy some time from someone who already knows how to do it.

      As for training materials, yes, definitely. The answer to that question is always affirmative, no matter the topic.

      Thanks again.

      PB

      Comment


        #4
        PB,

        If you would like to take on learning NinjaScript, we have a fully documented help guide which will help you get started with Ninja Script. You will find language references to all of the methods and functions you will be using. You will also see a tutorial section which will help you create your first indicator and get you started with some of these concepts.
        A link to our Help Guide with set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide:


        The entire Alphabetical Reference can be found with the following link:


        The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.

        I'm also proving a link to a pre-recorded set of videos 'Strategy Builder 301' and 'NinjaScript Editor 401' for you to view at your own convenience.
        Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt...We0Nf&index=10
        NinjaScript Editor 401 - https://www.youtube.com/watch?v=BA0W...ZmVnauWXkWe0Nf

        If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:


        I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:


        We also have a few tutorials in our NinjaTrader 7 help guide for both Indicators and Strategies.



        You will find Reference Samples online as well as some Tips and Tricks for both indicators and strategies:
        Click here to see our NinjaScript Reference Samples: http://www.ninjatrader.com/support/f...splay.php?f=30
        Click here to see our NinjaScript Tips: http://www.ninjatrader.com/support/f...ead.php?t=3229

        These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

        As always feel free to ask any other questions you may have.
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Thanks again.

          Breen

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,606 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          15 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X