Hi WealthLab Community,
I’m working on developing a Multi-Timeframe (MTF) indicator/strategy and need some guidance. Specifically, I’m looking for a code example that calculates the average values of an indicator (e.g., SMA) over multiple timeframes (e.g., 3-4 aggregation periods). The indicator would then use these averaged values to identify key signals such as crossovers or trend changes.
For example:
• The strategy should calculate an SMA over timeframes such as 15, 20, 30, and 60 minutes.
• It would then average these SMA values to create a composite SMA for each timeframe (Fast SMA and Slow SMA).
• Using these averaged SMAs, the indicator/strategy would generate buy/sell signals when the Fast SMA crosses above or below the Slow SMA.
I’m looking for:
1. An MTF indicator example that supports aggregating indicator values across different timeframes.
2. A strategy example demonstrating how to utilize the calculated MTF indicator for buy/sell signals.
If anyone has experience with this or can provide sample code, I would greatly appreciate it!
Thanks in advance for your help.
I’m working on developing a Multi-Timeframe (MTF) indicator/strategy and need some guidance. Specifically, I’m looking for a code example that calculates the average values of an indicator (e.g., SMA) over multiple timeframes (e.g., 3-4 aggregation periods). The indicator would then use these averaged values to identify key signals such as crossovers or trend changes.
For example:
• The strategy should calculate an SMA over timeframes such as 15, 20, 30, and 60 minutes.
• It would then average these SMA values to create a composite SMA for each timeframe (Fast SMA and Slow SMA).
• Using these averaged SMAs, the indicator/strategy would generate buy/sell signals when the Fast SMA crosses above or below the Slow SMA.
I’m looking for:
1. An MTF indicator example that supports aggregating indicator values across different timeframes.
2. A strategy example demonstrating how to utilize the calculated MTF indicator for buy/sell signals.
If anyone has experience with this or can provide sample code, I would greatly appreciate it!
Thanks in advance for your help.
Rename
QUOTE:
Using these averaged SMAs, the indicator/strategy would generate buy/sell signals when the Fast SMA crosses above or below the Slow SMA.
The MACD indicator is already doing this, except it employs multiple EMAs rather than SMAs.
I would concentrate on building your strategy around the MACD indicator, which has a proven and respected track record in the momentum trading world.
Perhaps a combination of two Transformer indicators could help: ScaleInd to access the data on a higher scale and MathIndOpInd to do the math. But it'd be easier to do it in C# code.
MTF indicator examples are shown in the QuickRef - search for TimeSeriesCompressor and TimeSeriesSynchronizer.
You can see the examples here too:
https://www.wealth-lab.com/Support/ApiReference/TimeSeriesCompressor#ToMinute
Once you have all those TimeSeries synchronized, you just add and average them for the composite indicator.
If you need help creating custom indicators per your requirements, send a request Concierge Service. A formal custom indicator can be used directly in no-code Block Strategies.
You can see the examples here too:
https://www.wealth-lab.com/Support/ApiReference/TimeSeriesCompressor#ToMinute
Once you have all those TimeSeries synchronized, you just add and average them for the composite indicator.
If you need help creating custom indicators per your requirements, send a request Concierge Service. A formal custom indicator can be used directly in no-code Block Strategies.
Your Response
Post
Edit Post
Login is required