Is there a way using building blocks to create a symbol based on a ratio? For example, I want a symbol that is the result of SPY/TLT then use that series in an SMA indictor
Rename
You can use MathIndOpInd which performs an operation on two indicators.
For the two indicators, select SymbolData(SPY) and SymbolData(TLT) and select Divide for the operation.
For the two indicators, select SymbolData(SPY) and SymbolData(TLT) and select Divide for the operation.
To apply an SMA to that you'll need the SmoothInd indicator, you'll be using a SmoothInd of the MathIndOpInd that I described above ...
This is awesome. I am a C# developer and always tend to go to code. However, the options and flexibility built into the indicators and building blocks is tremendous. I can spend more time testing strategies rather than debugging code. But code is always available if needed :-)
BTW, great job adding the building blocks to the Rotation Strategy!
BTW, great job adding the building blocks to the Rotation Strategy!
So for fun, I wanted to build this into a custom indicator for easier reuse. I could not figure out in an IndicatorBase how to get symbol history data. There is a GetHistory function in StrategyBase but didn't find something similar in IndicatorBase.
Use WLHost.Instance.GetHistory
Your Response
Post
Edit Post
Login is required