Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to use the TimeHistogram indicator in an automated strategy

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

    Trying to use the TimeHistogram indicator in an automated strategy

    Hello everyone

    I've been working on an automated strategy and now wanted to add the TimeHistogram indicator so that I can access the information if the last time bar was below or above the MA of the indicator.

    If there is another way to set that up in a strategy without using the indicator then that's ok too.

    I don't have much experience in programming, learning it step by step. So I appreciate all the help I can get.

    Attached below you can see a screenshot with the chart and the indicator (ES 12-11, 4 Range) plus the indicator itself as a file.

    Thank you for your help in advance.
    Attached Files

    #2
    TradingDS,

    Here is an example of calling the MACD from a strategy.

    MACD(slow,fast,smooth).Diff[0] // this is the histogram of the MACD
    MACD(slow,fast,smooth).Avg[0] // this is the smoothed macd

    You can call your indicator in a similar way.

    TimeHistogram TimeHistogram(int boundary1, int boundary2, int boundary3, int boundary4, int boundary5).PlotX[Y]

    Where X and Y are dependent on which plot you want to access, and which index of the plot.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Tradingds View Post
      Hello everyone

      I've been working on an automated strategy and now wanted to add the TimeHistogram indicator so that I can access the information if the last time bar was below or above the MA of the indicator.

      If there is another way to set that up in a strategy without using the indicator then that's ok too.

      I don't have much experience in programming, learning it step by step. So I appreciate all the help I can get.

      Attached below you can see a screenshot with the chart and the indicator (ES 12-11, 4 Range) plus the indicator itself as a file.

      Thank you for your help in advance.
      I do not see in the code where you have set the moving average of the indicator. Worse yet, with 6 independent plots in the indicator, the tern "moving average of the indicator" is essentially undefined at best.

      Changing the plot color in NT7.x can be done using one Plot. That is probably what you want to do, before you can even start to think in terms of a moving average.

      ref: http://www.ninjatrader.com/support/f...89&postcount=1

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      668 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X