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 CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      24 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      25 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-25-2026, 09:53 PM
      0 responses
      30 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 03-25-2026, 09:51 PM
      0 responses
      18 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 03-23-2026, 11:13 AM
      0 responses
      28 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X