Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculation on prices

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

    Calculation on prices

    Hi there,

    Within the development of indicators on NT6.5/7 can you, for example:
    Take the high and low of the previous bar's price and then the high and low prices on the close of the current bar.
    Then calculate as follows: (high - low close of current) / (high - low previous) = x.

    If x < y make an indicator.

    Can this or something similar be done?

    Cheers,

    Z

    #2
    Hello zhorny,

    Yes, this is possible with NinjaScript. Please see here for a tutorial on conditional plots:


    That tutorial uses a conditional operator, but you can also use if statements to evaluate.

    double x = (High[0] - Low[0]) / (High[1] - Low[1]);

    if (x < y)
    Plot0.Set(1);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Excellent.
      Can one do the same on other indicators e.g. MACD and Volume?
      Next step...learn how to program!

      Comment


        #4
        Yes, it would work pretty much the same with other indicators as well. To get strated with NinjaScript, you should look at using the strategy wizard. This offers a point and click interface. You define conditions by selecting within a GUI and can then view the code for these selections.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 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
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X