- ago
I have the same c# strategy running on a dev machine and a trading machine. The dev machine has Win 11 and the trading machine has win 10 pro. I am getting different results using the same c# code and data. So, I write a line of code to write to the Debug Log the bars info for date&time, open, high, low, close and volume. On my win11 laptop, I'm getting data that starts at 9:30AM. On my trading laptop, I'm getting data that starts at 9:35AM. I set the market to US Stocks when I run the backtester for both machines. Anyone know a simple fix to this problem? Both machines are running the same version of WL8 - latest version. The extensions are different except TDA is the same. I put that line of diags in a new c# strategy and I get the same result. Is it some preference I’m not seeing?
0
325
Solved
6 Replies

Reply

Bookmark

Sort
- ago
#1
Data providers across the machines may be different i.e. you may be getting the bars from different providers. See their order and enabled state (checkbox) in the Data Manager.
0
- ago
#2
I will check that in the morning. Thanks!
0
- ago
#3
I tried using my existing setup on my trading laptop (latest WL8, Win 10 Pro). I changed the Historical Provider to TDAmeritrade only. It still wasn't giving the correct TQQQ 5-minute data starting at 9:30AM. It always shows data from 9:35AM and on. So, I decided to reset my trading laptop. I told Windows to keep the files but had it delete the apps and settings. After Win 10 Pro was reset, I reinstalled the latest WL8, TDAmeritrade and CandleSticks. I've selected TD Ameritrade as my historical provider and set the consumer key. I've pasted the code and the partial results of the debug log. It still does the same thing. Why don't I get the data starting at 9:30AM? Am I missing something?

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { 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) {          WriteToDebugLog("date/time = " + bars.DateTimes[idx].ToShortDateTimeString() + " " +             bars.Open[idx].ToString() + " " +             bars.High[idx].ToString() + " " +             bars.Low[idx].ToString() + " " +             bars.Close[idx].ToString() + " " +             bars.Volume[idx].ToString() + " ");          if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below } }

TRADING LAPTOP OUTPUT
date/time = 2/12/2024 15:40 59.64 59.69 59.57 59.5842 281524
date/time = 2/12/2024 15:45 59.585 59.62 59.525 59.6036 492462
date/time = 2/12/2024 15:50 59.61 59.71 59.6 59.6001 530396
date/time = 2/12/2024 15:55 59.61 59.73 59.56 59.59 959603
date/time = 2/12/2024 16:00 59.58 59.596 59.435 59.55 1395447
date/time = 2/13/2024 09:35 56.24 56.34 55.83 56.23 4609886
date/time = 2/13/2024 09:40 56.23 56.62 56.18 56.535 2657090
date/time = 2/13/2024 09:45 56.54 56.585 56.2501 56.395 1914210
date/time = 2/13/2024 09:50 56.3902 56.62 56.36 56.42 1222070
date/time = 2/13/2024 09:55 56.42 56.8 56.265 56.7402 1493271
date/time = 2/13/2024 10:00 56.73 56.8 56.54 56.705 1524665

DEV LAPTOP OUTPUT
date/time = 2/12/2024 15:45 59.585 59.62 59.525 59.6036 492462
date/time = 2/12/2024 15:50 59.61 59.71 59.6 59.6001 530396
date/time = 2/12/2024 15:55 59.61 59.73 59.56 59.59 959603
date/time = 2/12/2024 16:00 59.58 59.596 59.435 59.55 1395447
date/time = 2/13/2024 09:30 56.19 56.29 56.1398 56.23 210939
date/time = 2/13/2024 09:35 56.24 56.34 55.83 56.23 4609886
date/time = 2/13/2024 09:40 56.23 56.62 56.18 56.535 2657090
date/time = 2/13/2024 09:45 56.54 56.585 56.2501 56.395 1914210
date/time = 2/13/2024 09:50 56.3902 56.62 56.36 56.42 1222070
0
- ago
#4
QUOTE:
It still wasn't giving the correct TQQQ 5-minute data starting at 9:30AM. It always shows data from 9:35AM and on

9:35am is correct because by WL's convention, bars are timestamped end-of-bar. (WL even has a special option to convert start-of-bar data in the ASCII provider for that matter.) I'm not an expert in TDA by any means, just make sure your Markets are exactly the same on both PCs.

In general, to guarantee equality I'd recommend physically sync data between the PCs by copying it from one to another. Same for Wealth-Lab's configuration files where you might've applied custom tweaks to the Markets/Symbols on one PC.
1
Cone8
 ( 6.32% )
- ago
#5
QUOTE:
just make sure your Markets are exactly the same on both PCs.
Correct. Probably you created a different market (see Tools > Markets & Symbols) and changed the opening time for TQQQ for the intraday version 1% per week strategy.
1
Best Answer
- ago
#6
Eugene and Cone: Thanks for your help! I was able to fix the problem on my trading laptop. Both machines now match!! Cheers!
1

Reply

Bookmark

Sort