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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        30 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        282 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        132 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        90 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X