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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      65 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      23 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      26 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X