Good evening
I want to build myself a RSL indicator, can anyone help me with this code?
Close / SMA.Series( Bars . Close , Period)[bar];
Greetings Didi
I want to build myself a RSL indicator, can anyone help me with this code?
Close / SMA.Series( Bars . Close , Period)[bar];
Greetings Didi
Rename
Here's that pattern to create and use a simple ad-hoc indicator -
If the goal is to create a formal Indicator that you can use in Blocks, then you need to work with the Indicator Builder in Administrator mode.
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript16 { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) { int period = 10; _myIndicator = bars.Close / SMA.Series(bars.Close, period); } public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { if (_myIndicator[idx] > 1.2) // just showing you how to get a value at idx PlaceTrade(bars, TransactionType.Buy, OrderType.Market); } else { } } private TimeSeries _myIndicator; } }
If the goal is to create a formal Indicator that you can use in Blocks, then you need to work with the Indicator Builder in Administrator mode.
I think that topic starter can also use the MathIndOpInd indicator, choosing "Close" as Indicator1 and SMA(Period) for Indicator2. It's found in the Transformers group of built-in indicators.
Just make sure to type in a different pane name (e.g. "RSL") rather than the default "Price".
Just make sure to type in a different pane name (e.g. "RSL") rather than the default "Price".
Yep, we created these "Transformer" indicators just for jobs like this, to save you the trouble of having to create a bespoke indicator.
@Cone
Thank you for this code!
Unfortunately I am a total beginner in Wealth Lab. I took the code and wanted to build a new indicator, so I just pasted your formula into the empty code, but there come lots of error messages
Thank you for this code!
Unfortunately I am a total beginner in Wealth Lab. I took the code and wanted to build a new indicator, so I just pasted your formula into the empty code, but there come lots of error messages
Then you shouldn't use code because you're not a programmer.
Instead, create block strategies, and wherever an Indicator is required, you can use the Transformer group to create it as suggested above. Specifically, you need to use the MathOpInd indicator to form your indicator.
Example -
Here are all the Transformers. Click on each on and see the Description below it.
You can play with them and create combinations of indicators by dragging them into a chart, for example.
Instead, create block strategies, and wherever an Indicator is required, you can use the Transformer group to create it as suggested above. Specifically, you need to use the MathOpInd indicator to form your indicator.
Example -
Here are all the Transformers. Click on each on and see the Description below it.
You can play with them and create combinations of indicators by dragging them into a chart, for example.
Your Response
Post
Edit Post
Login is required