Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript Help Wanted: I am new to NinjaTrader, not a programmer

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

    NinjaScript Help Wanted: I am new to NinjaTrader, not a programmer

    I have written a little ThinkScript & EasyLanguage, but not C# or similar. Please help me with my first indicator, something simple ...

    Primarily, an average of a calculation for the past number of specified bars.
    A lower-plot to display a single line.

    ThinkScript: average(((high-low) / ((open+close) / 2)),barLength)*100;
    Code:
            protected override void OnBarUpdate()
            {						 			
    			double calc = ( ( (High[0]-Low[0])/(Open[0]+Close[0]) ) /2 )*100;
    			
    			Line1.Set(calc);
            }
    See attached an initial preliminary file.

    How is the input user-specified number of bars handled? Average?

    If you can write all for me -- Great! And/or, I appreciate any help and/or direction that you can provide.

    I have been reading many NinjaTrader items. Please suggest any related references?

    Thanks!
    -- Tren D
    Attached Files

    #2
    Hello,

    Thank you for your post and welcome to our forums!

    The user-specified number of bars is handled from the number of "Days to Load" on your chart.

    We would not be able to program your strategy for you, but we do have a number of NinjaScript consultants you may contact:



    If you would like to take on learning NinjaScript on your own, 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 can be found below: http://www.ninjatrader.com/support/h...stribution.htm

    You will fine Reference Samples online as well as some Tips and Tricks for both indicators and strategies:
    Click here to see our NinjaScript Reference Samples


    Click here to see our NinjaScript Tips
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X