kazuna8
 ( 34.34% )
- ago
The following code is supposed to disable displaying the volume pane, event icons, and the trade arrows but they are still displayed if many are drawn on the chart.

[Strategy Settings]
Single Symbol: SPY
Data Scale: Daily
Data Range: All Data

CODE:
namespace WealthScript { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) {          ChartDisplaySettings cds = new ChartDisplaySettings();          cds.ShowVolumePane = false;          cds.PaneSeparatorWidth = 1;          cds.ColorPaneSeparator = WLColor.Black;          cds.ShowEventIcons = false;          cds.DisplayTradeArrows = false;          SetChartDrawingOptions(cds);       } public override void Execute(BarHistory bars, int idx) { if (HasOpenPosition(bars, PositionType.Long)) { if (LastOpenPosition.BarsHeld > 2) { PlaceTrade(bars, TransactionType.Sell, OrderType.Market); } } else { if (idx % 5 == 0) { PlaceTrade(bars, TransactionType.Buy, OrderType.Market); } } WLColor outer = WLColor.Orange; WLColor inner = WLColor.Black; DrawDot(idx, bars.Close[idx] * 0.99, outer, 3); DrawDot(idx, bars.Close[idx] * 0.99, inner, 1); } } }
2
310
7 Replies

Reply

Bookmark

Sort
- ago
#1
Not for me. When I comment the DrawDot out I see nothing on the chart.
0
kazuna8
 ( 34.34% )
- ago
#2
Did you set the Data Range to All Data for SPY?
Mine starts from 1996/01/02.
Shorter data range won't have the problem but only when it's longer.
0
Glitch8
 ( 12.10% )
- ago
#3
After some 50,000 or so drawing commands future ones are ignored for efficiency. That’s why some drawing commands are not processed when drawing a dot on every bar for large datasets.
0
kazuna8
 ( 34.34% )
- ago
#4
It worked fine on WL6 and I see no noticeable performance degradation on WL8.
Is it .NET doing the throttling or WL?
0
- ago
#5
WL6 = WinForms
WL8 = NET Core 8, WPF
0
kazuna8
 ( 34.34% )
- ago
#6
My question is whether expanding the drawing objects on WL8 is possible.
0
Glitch8
 ( 12.10% )
- ago
#7
We can make it an option, I’ll tag this as a #FeatureRequest
1

Reply

Bookmark

Sort