- ago
When testing minute-level strategies, I found that when Futures Mode is checked, regardless of whether SPY is used as a Symbol or Benchmark, the backtest results are abnormal.

And it also significantly affects the time required for backtesting when spy used as Benchmark.

I observed the same phenomenon in Wealth Lab 8 and 9, and my minute data comes from Iqfeed.

Below are some screenshots:


0
56
Solved
6 Replies

Reply

Bookmark

Jump to End
- ago
#1
Do you have SPY defined as a symbol in your Markets and Symbols tool?
0
- ago
#2
Hi Glitch,

I have checked this setting and it should not have any SPY or other codes that might be misidentified.

I have not used the migrate feature, WL9 has been set up completely from scratch, as shown in the screenshot below:



And even with a completely empty Block strategy, I could reproduce this issue



and it seems that the problem only appears on 1-minute data.


0
Cone8
- ago
#3
The Provider must be assigning it to Futures.
Which provider is it?..

IQFeed. Yes, I've seen that happen before too, possibly caused by temporarily having made SPY a Futures symbol. Here's how to fix it...

Open SPY in a chart for each affected scale, right click the chart > Reload Data from Provider.
Fixed.
0
- ago
#4
Run this strategy on a 1 minute SPY and report back what the Debug window contains.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript2 { 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) {          WriteToDebugLog(bars.DataSource);          if (bars.SymbolInfo == null)             WriteToDebugLog("NULL");          else          {             WriteToDebugLog(bars.SymbolInfo.SecurityType);             WriteToDebugLog(bars.SymbolInfo.Margin);             WriteToDebugLog(bars.SymbolInfo.PointValue);             WriteToDebugLog(bars.SymbolInfo.TickSize);          } } //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 (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below } }
0
- ago
#5
Hi Glitch & Cone,

I solved this problem using Cone's method in Wealth Lab 9.

I ran the script given by Glitch in WL8, and the log I got is like this:

---Symbol by Symbol Debug Logs---
---SPY---
IQFeed
Future
1
1
0
0
Best Answer
- ago
#6
Glad to hear it's solved!
0

Reply

Bookmark

Jump to Top