- ago
Hello,

I'm currently trying to import weekly AAII sentiment data. I’ve created an ASCII data source and successfully imported the CSV file, and everything appears to be working fine.

However, when I try to open the symbol (by double-clicking in the DataSets tree), I encounter the following message: "Could not obtain historical data for symbol: AAIIBULL". The default scale is set to Daily.

I then manually change the scale to Weekly, but nothing changes immediately. If I navigate to another item in the DataSets tree and then return to the symbol AAIIBULL, the chart becomes visible. While this workaround functions, it feels somewhat awkward.

The main issue arises when I attempt to incorporate this data into my SPY trading strategy. Both of the following lines of code return null:
CODE:
aaiiBull = GetHistoryUnsynched("AAIIBULL", HistoryScale.Weekly); aaiiBull = BarHistorySynchronizer.Synchronize(bars, aaiiBull);

and
CODE:
aaiiBull = GetHistory(bars, "AAIIBULL");

Could you help me understand what might be going wrong?



Thank you
0
118
Solved
12 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.29% )
- ago
#1
Is your auto-generated ASCII Historical Provider enabled in the Data Manager, Historical Provider tab? You might also bring it to the top or closer to the top. Finally, you can specify the name of the DataSet in GetHistory to make it use your DataSet first.
0
- ago
#2
WL8 has been supporting AAII data in a smart way through the Quandl provider (part of the DataExtensions). Have you tried that first?

EDIT: We need to reflect the availability of Quandl's data series better in the extension's description, though.

EDIT-2: Made the update:
* Visualize countless core financial and alternative data sets from Quandl like AAII investor sentiment, NAAIM, FINRA, ISM series etc.
0
- ago
#3
OK, I see a breaking change that Nasdaq returns for Quandl API requests. Furthermore, the source data series seems to have ceased to update. Disregard my message above then.
0
- ago
#4
QUOTE:
Is your auto-generated ASCII Historical Provider enabled in the Data Manager, Historical Provider tab?


Yes, it was enabled, I moved to the top, explicitly specified DataSet name, no luck.
I also described the strange behaviour if I just double-click on the Symbol in the DataSet, it doesn't work for the first time.

I tried this:
CODE:
BarHistory aaiiBull1 = GetHistory(bars, "AAIIBULL", "AAII"); BarHistory aaiiBull2 = GetHistoryUnsynched("AAIIBULL", HistoryScale.Weekly);


I get the following message: Could not load Backtest Data in this Scale/Range.

I didn't try any other external DataSource, as I mostly rely on local CSV files that are most reliable and autonomous.
0
Glitch8
 ( 11.29% )
- ago
#5
Sorry but the download is an EXE file. If you can place the ASCII file somewhere like Google Drive where I can download it without launching an untrusted EXE file I'll check it out.
0
- ago
#6
That's really strange, I didn't upload any EXE file. Nevertheless, here is th Google Drive link: https://drive.google.com/drive/folders/1zJi6XQzDNgdBW-wZdgmiCbul_Vb5otJj?usp=sharing

Thank you
0
Glitch8
 ( 11.29% )
- ago
#7
I created a DataSet with your CSV file then ran the following code on SPY, Daily.

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) {          BarHistory aaiiBull = GetHistoryUnsynched("AAIIBULL", HistoryScale.Weekly);          aaiiBull = BarHistorySynchronizer.Synchronize(aaiiBull, bars);          PlotBarHistory(aaiiBull, "AAIIBULL", WLColor.Teal); } //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 } }


It worked and plotted the scaled out data for your symbol. Also, if I ran the Strategy on SPY Weekly and used GetHistory instead of GetHistoryUnsynched, it still worked. I'm not sure what's going on at your end but working fine here.

1
Glitch8
 ( 11.29% )
- ago
#8
>> However, when I try to open the symbol (by double-clicking in the DataSets tree), I encounter the following message: "Could not obtain historical data for symbol: AAIIBULL". The default scale is set to Daily.<<

Although this isn’t your main issue I’m going to see about improving this behavior so the chart can open directly to weekly in this case.
1
- ago
#9
"It worked and plotted the scaled out data for your symbol."
I managed to make it work with your code, but what I had to do is to change the main symbol, Backtest Data -> Symbol: AAIIBULL -> SPY. It doesn't work with AAIIBULL, isn't that weird?

With AAIIBULL set I get "Could not load Backtest Data in this Scale/Range."
0
Glitch8
 ( 11.29% )
- ago
#10
Did you remember to change the scale to weekly?

1
- ago
#11
Sorry, my bad. Now works fine! Thank you!!
0
Glitch8
 ( 11.29% )
- ago
#12
Good, also, the annoyance you described earlier is fixed for B101. When you click your symbol that chart should default to weekly.
1
Best Answer

Reply

Bookmark

Sort