Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Four Hour SMA Indicator

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

    Four Hour SMA Indicator

    Hi Ninjas,

    I am trying to create a simple indicator which allows you to overlay the 4Hr or any other time frame moving average over your primary Bars on a chart.

    I have tried doing it in the strategy but I could not create a new Plot and I also tried creating an indicator to calculate this but I can not add 240 minute bars for the close value.

    Is there anyway to do this? Can I plot directly from the strategy?

    I also tried to Add(SMA(BarsArray[5],period) in initiailize() and OnStartup(), where this array is 240 min, where should this go?
    Last edited by arilano; 12-09-2014, 04:22 AM.

    #2
    never mind, I realised that I could simply use a 224 period SMA as this is 16*14.

    Duh!

    Thanks

    Comment


      #3
      arilano, that would be an approximation yes.

      The strategy could not plot directly, however you could Add() for example a MultiSeries indicator that would calculate your higher timeframes SMA value then and provide the plot.

      The series would be added in the indicators Initialize() method and then you could point the BarsArray[1] in your SMA calculations.



      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CortexZenUSA, Today, 12:53 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by CortexZenUSA, Today, 12:46 AM
      0 responses
      0 views
      0 likes
      Last Post CortexZenUSA  
      Started by usazencortex, Today, 12:43 AM
      0 responses
      2 views
      0 likes
      Last Post usazencortex  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      168 responses
      2,262 views
      0 likes
      Last Post sidlercom80  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X