Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

52-week high in strategy wizard

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

    52-week high in strategy wizard

    I hope someone will help me with a total newbie question--- Can some please tell me how to use a [period]-high/low -- like 52-week high, or 10-day low in the strategy analyzer wizard? I'd prefer to do it with using user defined inputs for the numerical value. Thanks very much!

    #2
    Hello Matt65000,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    Unfortunately, you wouldn't be able to find a period-high or period-low with using the Strategy Wizard. You would need to unlock the code and manually program this yourself.

    I would suggest using the Strategy Wizard to create your user defined input and any other logic needed and then unlocking the code.

    You can then call the MIN() method to find your period-low and MAX() to find your period-high.




    Both help guide links provide an example of finding the highest high and lowest low over a period of 20, but you can replace the 20 with the name of your user defined input variable.

    Here is a quick example below of printing the highest high:
    Code:
    // the period variable here is my user defined input
    private int period = 20;
    
    protected override void OnBarUpdate()
    {
         Print(MAX(High, period))[0]);
    }
    We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:
    Click here to see our NinjaScript Reference Samples
    Click here to see our NinjaScript Tips

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

    Further, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.
    Alphabetical Reference

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

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the info! I'm looking forward to playing around with this since I write C# code for a living. I wish Ninjatrader were based near my hometown--I'd love to work on a product like this!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      61 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      40 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      21 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      23 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X