I set position size as 10% of equity. However, the order manager appears to be using % equity for setting sell size instead of selling entire position.
I created this simple test strategy using Building Blocks.
Is there something in the auto-generated code that needs to be changed?
CODE:
Signal Quantity Symbol "Security Name" "Order Type" "Order Price" Status "Fill Qty" "Fill Price" Timestamp Sell 750 QQQ INVESCO QQQ TRUST SERIES 1 Market 0 Filled 750 318.82 4/28/2022 07:03:04 Buy 762 QQQ INVESCO QQQ TRUST SERIES 1 Market 0 Filled 762 323.41 4/28/2022 06:31:02
I created this simple test strategy using Building Blocks.
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript4 { public class MyStrategy : UserStrategyBase { public MyStrategy() : base() { } public override void Initialize(BarHistory bars) { indicator1 = new EMA(bars.Close,5); PlotIndicator(indicator1,new WLColor(0,0,0)); indicator1.MassageColors = true; indicator2 = new EMA(bars.Close,60); PlotIndicator(indicator2,new WLColor(0,0,255)); indicator2.MassageColors = true; indicator12 = new EMA(bars.Close,5); indicator22 = new EMA(bars.Close,60); StartIndex = 60; } public override void Execute(BarHistory bars, int idx) { int index = idx; Position foundPosition0 = FindOpenPosition(0); bool condition0; if (foundPosition0 == null) { condition0 = false; { if (indicator1.CrossesOver(indicator2, index)) { condition0 = true; } } if (condition0) { _transaction = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, 0, "Buy At Market (1)"); } } else { condition0 = false; { if (indicator12.CrossesUnder(indicator22, index)) { condition0 = true; } } if (condition0) { ClosePosition(foundPosition0, OrderType.Market, 0, "Sell At Market (1)"); } } } private IndicatorBase indicator1; private IndicatorBase indicator2; private IndicatorBase indicator12; private IndicatorBase indicator22; private Transaction _transaction; } }
Is there something in the auto-generated code that needs to be changed?
Rename
In Preferences > Trading, you can enable "Always set Exit Order Quantity to full Position Quantity".
Thank you. I now see another trading preference checkbox option "Use Broker-reported Account Value...."
How does this work? Is it an API feature that became available when I installed IB extension?
How does this work? Is it an API feature that became available when I installed IB extension?
While viewing that page, just strike F1 and it's explained in the Help ;)
Thank you. My question is whether the broker (IB) API is enabling this feature.
It's a Wealth-Lab function.
Wealth-Lab gets the account value via broker APIs and uses it as the total Equity value for Pct of Equity sizing for new signals.
Wealth-Lab gets the account value via broker APIs and uses it as the total Equity value for Pct of Equity sizing for new signals.
Wow. That's fantastic!!! I was going to write up a feature request for that!
Just curious.... If I did not have the IB broker extension installed, would this preference still be displayed, or inactivated / greyed out?
Just curious.... If I did not have the IB broker extension installed, would this preference still be displayed, or inactivated / greyed out?
It would still be displayed, it can be used with any Broker, even the "Dummy Broker" that comes with WL8.
Your Response
Post
Edit Post
Login is required