-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathData_from_AV.c
36 lines (31 loc) · 967 Bytes
/
Data_from_AV.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function run()
{
set(LOGFILE|PLOTNOW);
StartDate = EndDate = 2020;
BarPeriod = 240;
LookBack = 0;
// if(is(INITRUN)) assetHistory("SPY", FROM_AV);
assetHistory("SPY", FROM_AV);
asset("SPY");
vars Closes = series((priceClose()));
plot("SPY AV",Closes,NEW,BLUE);
// string Name;
// int n = 0;
// int i, j;
// while(Name = loop("SPY", "CWI", "CSJ", "HYG", "TLT"))
// {
// if(is(INITRUN)) assetHistory(Name,FROM_AV);
// asset(Name);
// Returns[n] = series((priceClose(0)-priceClose(1))/priceClose(1));
// n++;
// }
// if(!is(LOOKBACK))
// {
// // plot returns
// plot("SPY Returns", Returns[0], NEW|BARS, BLUE);
// plot("CWI Returns", Returns[1], NEW|BARS, BLUE);
// plot("CSJ Returns", Returns[2], NEW|BARS, BLUE);
// plot("HYG Returns", Returns[3], NEW|BARS, BLUE);
// plot("TLT Returns", Returns[4], NEW|BARS, BLUE);
// }
}