Issue: The Trade Signals are showing incorrect position size if there is more than one open position for a symbol.
It appears the size of the first position is being used for all positions.
Using Build 72; issue noticed after a recent update.
It's easily verified, as follows:
Test code:
Settings:
Positions tab shows correct sizes:
Signals tab shows incorrect sizes (all positions have size of 1st position):
Issue is also present in Strategy Monitor.
It appears the size of the first position is being used for all positions.
Using Build 72; issue noticed after a recent update.
It's easily verified, as follows:
Test code:
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript9 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (idx == bars.Count -2) PlaceTrade(bars, TransactionType.Buy, OrderType.Market); if (idx == bars.Count - 22) PlaceTrade(bars, TransactionType.Buy, OrderType.Market); if (idx == bars.Count - 42) PlaceTrade(bars, TransactionType.Buy, OrderType.Market); foreach (Position p in OpenPositions) ClosePosition(p, OrderType.Limit, p.EntryPrice *2, "100% Profit"); } //declare private variables below } }
Settings:
Positions tab shows correct sizes:
Signals tab shows incorrect sizes (all positions have size of 1st position):
Issue is also present in Strategy Monitor.
Rename
Thanks, we'll look into that ASAP!
Thanks for the report, we have it corrected for Build 73.
Working OK in B73... thanks.
Your Response
Post
Edit Post
Login is required