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 Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      5 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X