- ago
The building block "Dynamic Portfolio" (part of the finantic.DynmicPortfolio extension) has a parameter "MinNumTrades".

If this is set to a number smaller than 20 then an exception is thrown during the Initialize phase. The follwing code snippet is generated by "Open as C# Coded Strategy":
CODE:
public override void Initialize(BarHistory bars) {          indicator1 = bars.Close;          indicator2 = new SMA(bars.Close,10);          PlotIndicator(indicator2,new WLColor(0,0,0));          _startIndexList.Add(indicator2);          // Dynamic Portfoilo          if(dynPf == null)          {             // throws exception if MinNumTrades is smaller than 20             dynPf = new DynamicPortfolio)this, "MyStrategy", "Learning", 250, 250, 25,                80, 90, 1, "AvgProfitPct");          } foreach(IndicatorBase ib in _startIndexList) if (ib.FirstValidIndex > StartIndex) StartIndex = ib.FirstValidIndex; }


This exception is displayed when the strategy is run as C# Coded Strategy:


The message does not appear if run as a building block strategy.

Please show exceptions thrown from a building block strategy.
0
20
0 Replies

Reply

Bookmark

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