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.



      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      153 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      72 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X