- ago
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
0
382
Solved
5 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.64% )
- ago
#1
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.

0
Glitch8
 ( 11.64% )
- ago
#2
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 ...

1
Best Answer
- ago
#3
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!
1
- ago
#4
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.
0
Glitch8
 ( 11.64% )
- ago
#5
Use WLHost.Instance.GetHistory
0

Reply

Bookmark

Sort