- ago
Is it possible to build this system via Building Block?

Here is the code for reference. I do have the finatic indicators.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using finantic.Indicators; namespace WealthScript2 { public class MyStrategy : UserStrategyBase {       MP movingPercentile;                    public override void Initialize(BarHistory bars) {          TR tr = new TR(bars);          movingPercentile = new MP(tr, lookback: 100, percentile:75); } public override void Execute(BarHistory bars, int idx) {          foreach (var pos in OpenPositions) ClosePosition(pos, OrderType.Market);          double mpfactor = 0.7;          double limit = bars.Close[idx] - movingPercentile[idx] * mpfactor;          PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, limit); } } }
0
74
0 Replies

Reply

Bookmark

Sort
Currently there are no replies yet. Please check back later.