Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy help

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

    Strategy help

    I would like to code for a strategy as follows: close of the present bar is less than the close of the previous 8 bars. Thanks for the help

    #2
    Hello snotrag12,

    You may do this my manually checking the Close of the current bar with each bar manually, or you may use the MIN() method to be able to find the lowest value over a given period to be able to do this as well.

    Here is a link to our Help Guide that goes over the MIN method that you may view.
    JCNinjaTrader Customer Service

    Comment


      #3
      More problems

      Hi I tried to incorporate max into line 71 of my strategy, but I have some compilation errors.
      I am trying to code if the high of stochastic K over the past 10 bars is greater than 80. Appreciate the help
      Attached Files

      Comment


        #4
        Hello snotrag12,

        Thanks for the screenshot.

        This is because the second part of your statement on Condition 4 is invalid. You are reference the Stochastics K value and then placing a comma. If you would like to find the high value of the Stochastic you would replace the "High" with the Stochastic K.

        Example:

        Code:
        if(Stochastics(7,14,3).K [0] < 75
        				&& MAX(Stochastics(7,14,3).K,10)[0] > 80)
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X