• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Value Rising over number of bars

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

    Indicator Value Rising over number of bars

    Im trying to determine whether the market is trending or ranging using the Strategy Builder. One obvious way would be to look for an inclining/declining EMA/SMA, but if I use rising and falling in the strategy builder doesn't it only tell me whether the bar is rising/falling for the current bar, rather than over a period of time, or X number of bar ago? Basically how do you say 'If SMA/EMA is rising X bars ago?

    Thanks

    #2
    Hello

    Thank you for the post.

    Correct, the IsRising method would report true if the CurrentBar is greater than the Last bar. To make a range of bars which you check if they are rising, you would need to make a price condition.

    For example, checking if the Close 0 Bars Ago is greater than Close 1 BarsAgo would replicate the IsRising. In the same condition, you could add more of those price conditions like Close 1 BarsAgo is greater than Close 2 bars ago and so on. This would create a range of Rising statements.

    The same would apply with Indicators, you would need to create a new condition for each 1 bar span of time you want to compare.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Using a loop would allow the setting of how many bars to include in the test.
      eDanny
      NinjaTrader Ecosystem Vendor - Integrity Traders

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by johnnybegoode, Today, 11:35 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by NickyD, Today, 09:07 AM
      3 responses
      14 views
      0 likes
      Last Post NickyD
      by NickyD
       
      Started by 7robert, Today, 06:46 AM
      3 responses
      62 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by ElMagoR, Today, 07:49 AM
      4 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by Nabil, 09-13-2019, 11:44 AM
      5 responses
      35 views
      0 likes
      Last Post Nabil
      by Nabil
       
      Working...
      X