Backtesting Using External Data Fields

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
nibor200
Posts: 63
Joined: Wed Oct 22, 2014 11:03 am

Backtesting Using External Data Fields

Post by nibor200 »

Chris,

I was going to try out this new backtesting capability so I started out with a blank new script window and copied and pasted this from your blog:
myVal:= WB_SYMBOL_LOOKUP(‘C:\\myData\Top50GIR.xlsx’, ‘Values’);
cond1:= myVal == 1;
cond2:= COUNT(cond1, 80) >= 20;
event: cond1 & cond2;

and when I compiled it I got back seven CS1056 Errors, 4 were unexpected character '"" and 3 were unexpected character '\'

So I tried copying and pasting:
myVal:= WB_SYMBOL_LOOKUP('C:\\myData\Top50GIR.xlsx', 'Values');
cond1:= myVal == 1;
cond2:= COUNT(cond1, 80) >= 20;
cond3:= CROSS(C, EMA(C, 20));
event: cond2 & cond3;

and when I compiled it I got back 1 CS1009 error, Unrecognized escape sequence

When I write my own I get mixtures of both kinds of errors when I either compile or try to Save As.

Is there something I'm not doing correctly? because the first line in both looks identical to me yet the compile errors are not similar.
Thanks,
Ed S.
Chris White
Posts: 201
Joined: Mon Nov 29, 2010 9:21 pm

Re: Backtesting Using External Data Fields

Post by Chris White »

It looks like there were a couple of problems with the posted script (I will try to fix them in the blog post too so that noone else runs into this).

Here's a working version:

Code: Select all

myVal:= WB_SYMBOLLOOKUP('C:\\myData\\Top50GIR.xlsx', 'Values');
cond1:= myVal == 1;
cond2:= COUNT(cond1, 80) >= 20;
event: cond1 & cond2;
The problems were:
1. WB_SYMBOL_LOOKUP should be WB_SYMBOLLOOKUP
2. There should be two backslashes before the Top50GIR.xlsx filename
3. The Single quotes were translated by the blog software to be characters open single and close single quote. They need to be basic single quotes (which you get when typing your keyboard single quote button.

Chris.
nibor200
Posts: 63
Joined: Wed Oct 22, 2014 11:03 am

Re: Backtesting Using External Data Fields

Post by nibor200 »

Hey Chris,

That solved it!

Now for the problem I was expecting to run into:

I thought I'd combine the list output capability that you added to the Entries and Exits in the latest July Template with the external data field retrieval that you described in your latest blog post in a multiple column retrieval scenario.

I was concerned that it might not work because the new list view, arrays the information by rows of dates and symbols and your example for external data retrieval was using columns of dates with one symbol per row.

So I saved the popout Excel file for the AreaBB Entries Run in list view, and modified your external retrieval script to access that file, which it did.

I was hoping to see which of the 2 data columns it might access by having my script ouput everyline's variable, and then running that script in the Entry side of the Entries and Exit tab.

Unfortunately the output in the List View had 4 columns Date, Symbol,MyVal, and Cond1, and did not show a column for Cond2 and Event.
Also I expected to see different values in the MyVal column and I just got 1 for every entry.

1. Am I correct to conclude that the external data must be arrayed by symbol rows and date columns in order to properly extract the external data into a script?

2. If we c reate an excel workbook with multiple tabs with unique data per tab, can we have multiple calls in one script to that workbook as long as the tab part of the file name is different for each call of WB_SymbolLookup?

Thanks,
Ed S.
Chris White
Posts: 201
Joined: Mon Nov 29, 2010 9:21 pm

Re: Backtesting Using External Data Fields

Post by Chris White »

This is getting a little complicated to relay via text alone. Could you please record what you are doing using the free Jing tool and post me a link to that?
https://www.techsmith.com/jing.html
nibor200
Posts: 63
Joined: Wed Oct 22, 2014 11:03 am

Re: Backtesting Using External Data Fields

Post by nibor200 »

Hey Chris,

There is a much more concise version of my questions that has been sitting in your other Forum "Edgerater Scripting" for the better part of 2 weeks now, along with other questions.

Perhaps it would be easier for you to answer those questions, as creating that video on Jing would take quite a bit of time to include all steps.

Thanks,
Ed S.
Post Reply