You can code an indicator that only updates at the start of each new 4 hour candle. This gives a stepped result.
Here is an example for a 4 hour 20MA. If you increase the stored variables to 200 and then divide the sum of them by 200 you will have a 200MA. I got bored with the typing after 20 so I’ll leave the rest up to you!
Obviously you will need to make sure that your chart has at least 200 4 hour closes on it. A 10k 15 minute chart has over 3200 on it so you should be good to go. Happy typing and share the result here when you finish it please!
Making it update every fifteen minutes would be a coding nightmare and probably very slow to draw so I think this stepped MA is about as good as it gets. If it is just an indicator on a chart rather than a value from an indicator that you want then Nicolas’ MTF idea will probably suit you better.
Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.