- ago
I need to add a second TimeSeries (lowestSpread) line to an indicator I have developed, so that when the indicator class is used in a strategy, both lines are visible.



How can I realize that in WL7?
0
4,303
6 Replies

Reply

Bookmark

Sort
- ago
#1
To plot multiple indicators together you should use the Companions property:
https://www.wealth-lab.com/Support/ApiReference/IndicatorBase

For example, the FAMA indicator would override Companions as follows and for its companion MAMA indicator it would be vice versa:

CODE:
public override List<string> Companions { get { List<string> c = new List<string>(); c.Add("MAMA"); return c; } }
0
- ago
#2
Thanks.

Sounds like I need to program the same indicator twice, just under a different name and output to build the dependency from the primary to the secondary indicator, right?
0
- ago
#3
No. According to your screenshot this is not the same but two different indicators. Each indicator implements the Companions property in its own way.
0
Glitch8
 ( 10.65% )
- ago
#4
If it’s a building block strategy then there’s really no way to plot an additional line. BB strategies don’t plot indicator Companions, that’s just drag and drop. If it’s a C# coded Strategy then of course you just plot anything you like.

Are you looking for this in a BB Strategy?
0
- ago
#5
@Glitch
No, it's plain vanilla indicatior developed from scratch.

If I look at the Comanions Property, there's a hardcoded external indicator name attached to the property so I wonder, how to combine/overlap two TimeSeries (like spread and lowestSpread) in a single Indicator, without referencing any external "hardcoded" indicators.

In addition, I wonder how to catch these two TimeSeries values later using a startegie implementiation? In Ninjatrader this was quite simple, because this was exposed via public properties.



Has this been implemented similarly in Wealth Lab 7?
0
Glitch8
 ( 10.65% )
- ago
#6
No it’s not implemented like this in WL. In WL each indicator is its own class. If you want a strategy to reference two indicators, it can create an instance of each of the 2 indicators.
0

Reply

Bookmark

Sort