- ago
Wealth lab build 33.

I can not find a setting to controls the the display of alerts in the streaming charts.

I trade manually from streaming charts.

The alerts are useful to me, so I would like to have them back again.
0
575
Solved
6 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.98% )
- ago
#1
Probably there's a better spot, but they're here for now.



Other options -
1. Use Auto-Stage and get all of your signals in one place - the Order Manager.
2. Write the signals on the chart window with a colorful background.. like this -

0
- ago
#2
thanks, I didn't see it down at the bottom.,

What I see at the bottom of the chart, doesn't match the signals in the chart.
I'll try the auto-stage while I'm trying to understand what I see at the bottom of the chart.

The chart shows 3 closed positions, and one open position with an open limit/stop loss order pair.
what I see at the bottom of the chart is "(Buy $28,807.94 at Market 81 signals total)" and nothing about alerts. I would expect to see an alert for the limit order and an alert for the stop. (that is what I used to see).
a backtest of the same strategy and time frame lists four orders, 3 of which have been closed by either hitting the limit or stop, and one open position. that is exactly what is reflected on the streaming chart containing the strategy.
0
Cone8
 ( 4.98% )
- ago
#3
QUOTE:
what I see at the bottom of the chart is "(Buy $28,807.94 at Market 81 signals total)"
First, a Streaming Chart is usually going to have 1, maybe 2 signals. Only one will be visible in this status bar.

1. What kind of strategy are you running that generates 81 signals in a Streaming Chart?

2. You're getting a $dollar amount instead of shares because you've selected Basis Price: Market Open. Why would you do that for intraday trading?

CODE:
nothing about alerts.
Signals are Alerts. Alerts are Signals. "Buy $28,807.94 at Market" is the first of your 81 signals.

CODE:
I would expect to see an alert for the limit order and an alert for the stop.
If your strategy generates a Limit and Market order simultaneously, the Limit order will be "pruned" (removed).

That said, I don't know what else you should expect from a Strategy generating 81 signals in a Streaming window. If you care to share the strategy, I'll can be more helpful.
0
- ago
#4
Thanks,
I changed the basis Price to "Market Close This Bar"

I have attached the code, and images of strategy settings, backtest signals, and a streaming chart containing the strategy. The streaming chart now shows "Buy 343 at Market 63 signals total.
CODE:
using WealthLab.AdvancedSmoothers; using WealthLab.TASC; using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase {     public MyStrategy() : base() {          AddParameter("Bar Range", ParameterType.Int32, 9, 6, 30, 3);          AddParameter("Profit Target", ParameterType.Double, 12, 1.0, 15.0, 1.0);          AddParameter("Stop Loss", ParameterType.Double, 8, 1.0, 15.0, 1.0);          AddParameter("Lowest Low Multplier", ParameterType.Double, 2.0, 0.50, 3.0, 0.50);          AddParameter("Lowest Low Bar Range Multiplier", ParameterType.Int32, 6, 2, 8, 1); } public override void Initialize(BarHistory bars) {          _CAMA = new CAMA(bars, 45);          PlotIndicator(_CAMA, WLColor.Firebrick, PlotStyle.DottedLine);                 _TEMA = new TEMA(_CAMA,15);          PlotIndicator(_TEMA, WLColor.FromArgb(255,0,191,255), PlotStyle.Line);                              LowestLow_Multiplier = 1.0 + (Parameters[3].AsDouble /100.0);          trailStopPcnt = Parameters[2].AsDouble;                 BarRange = Parameters[0].AsInt;          LowestLowBarRangeMultiplier = Parameters[4].AsInt; // multiply the LowLow bar range by this                              ShortHigh = new Highest(bars.High,BarRange);          PlotIndicator(ShortHigh, WLColor.DarkRed, PlotStyle.Line);          ShortLow = new Lowest(bars.Low,BarRange);          PlotIndicator(ShortLow, WLColor.Gold, PlotStyle.Line);          ShortLowPlus = new Lowest((bars.Low)*LowestLow_Multiplier,BarRange);          PlotIndicator(ShortLowPlus, WLColor.Gold, PlotStyle.DashedLine);          LongLow = new Lowest(bars.Low, BarRange * LowestLowBarRangeMultiplier);          PlotIndicator(LongLow, WLColor.Coral, PlotStyle.DashedLine);                              BarLow = bars.Low;          ProfitPercent = Math.Round(Parameters[1].AsDouble, 2);          ProfitTargetMultiplier = (ProfitPercent / 100.0) + 1.0;                              SetPaneDrawingOptions("Volume", 10, 3);          IndicatorBase volSMA = new SMA(bars.Volume, 50);          PlotIndicator(volSMA, WLColor.DodgerBlue, PlotStyle.Line);                              PlotStopsAndLimits(6, true, true, null, WLColor.DodgerBlue, null, null);          StartIndex = BarRange + 2; } public override void Execute(BarHistory bars, int index) {          if (index > StartIndex)          {                          if(ShortLow[index] > LongLow[index])             {                if(_CAMA[index] >= _TEMA[index])                {                   if (BarLow[index] <= (BarLow.GetLowest((index), BarRange)) * LowestLow_Multiplier )                   {                      _transaction = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, 0, "Buy At Market (1)");                   }                }             }                             foreach(Position foundPosition0 in OpenPositions)             {                if (foundPosition0.PositionTag == 0)                {                   Backtester.CancelationCode = 71;                                     ClosePosition(foundPosition0, OrderType.Limit, foundPosition0.EntryPrice * ProfitTargetMultiplier, "Sell at " + ProfitPercent.ToString() + "% profit target");                }                                if (foundPosition0.PositionTag == 0)                {                   Backtester.CancelationCode = 71;                   CloseAtTrailingStop(foundPosition0, TrailingStopType.PercentC, trailStopPcnt, "Sell at " + trailStopPcnt.ToString() + "% trailing stop loss");                }                             }          } } public override void NewWFOInterval(BarHistory bars) {          BarLow = bars.Low; }       private int BarRange;       private TimeSeries BarLow;       private int LowestLowBarRangeMultiplier;       private double ProfitPercent;       private double ProfitTargetMultiplier;              private Transaction _transaction;       private IndicatorBase ShortLow;       private IndicatorBase ShortHigh;       private IndicatorBase ShortLowPlus;       private IndicatorBase LongLow;       private int StartIndex;       private double LowestLow_Multiplier;       private double trailStopPcnt;       private IndicatorBase _TEMA;       private IndicatorBase _CAMA;    } }





0
Cone8
 ( 4.98% )
- ago
#5
Wow, where do we start?

Let's get the innocuous one first -
StartIndex is a backtester property and you're defeating the purpose by declaring your own variable. Remove this declaration.
CODE:
private int StartIndex; // delete this line

Strategy Window (not the Streaming Window)
In your Strategy's Backtest Settings, you've chosen:
- Do not Retain NSF Positions
- 100% Equity Sizing and Max Open Pos: 1 (presumably)

Your code does nothing to limit the number of positions the script can open, but the 100% of Equity sizing at 1:1 margin essentially limits the backtest to holding 1 position even without the Max Open Pos setting. And now I understand why you chose Basis Price Open next bar. All of this works to limit your strategy to 1 positions for hypothetical backtesting, but not live trading.

Streaming Window
WL will not inhibit signals for live trading, and your strategy will be signaling to buy at market every time that entry condition is true. If your account has 6x Portfolio margin, you could even buy 6 100% of equity Positions at full Portfolio margin.

Since the Sizing control is set to 1:1 margin, the backtest creates those hypothetical NSF positions, and keeps generating the exit signals - because it doesn't know if your account traded those NSF positions or not (they were signals). This is the reason for the dozens of signals. You can avoid that, however, by enabling the Live Positions Trading Preference .

Recommendations:
1. Use the Live Positions preference. You can think of it as disabling NSF Postions for live trading. Read about all the Portfolio Sync Preferences. You probably want to use "Broker-reported account value" too.

2. If you only want to trade one position, you should add logic for that. It's just one if/else statement. If you open a new C# Coded strategy, the template code uses the single long position logic.

3. 100% of equity is okay for a margin account, but if its a Cash Account, 99% will probably be good enough to keep from getting a trade rejected intraday.

By the way, the stop/limit signals will appear in the chart window if their trigger prices are in the visible range and Preferences > Chart > Other Settings > Show Trade Signal Lines is checked.
1
Best Answer
- ago
#6
thanks,
I'll implement your recommendations.
0

Reply

Bookmark

Sort