Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/7/2005(UTC) Posts: 1,346
|
have you ever noticed the error message ' invalid price data request'..... metastock like most windows based programs remembers the last folder accessed ...... when using realtime if we were to open an intraday emc chart, odds are we would use our realtime data suppliers folder..... now lets say we want to look at emc daily but open it from one of our local data folders.... then if we wanted to open a second intraday emc we might try to use 'apply clean template' option on the lower tool bar..... ain't happin..... we get the price data error.....
reason..... meta is still lookin at our last accessed local data folder and the intraday 'price data' is not in it.... to open a second intraday, use the new window , under window on the top tool bar.....
if we have opened an intraday chart and have not changed folders, if using the apply clean template we will not get the 'price data error', but it will open a daily emc from our realtime supplier, not another intraday.......
speakin of emc, hmmmmm..... when attemptin an acapulco swan dive they say timing is everything..... ouch, was that a rock i hit or a treasure chest, will know which in a couple days.....h
i used the dia, spy, and qqqq as etf reference's .... you will have to change the security path to suit your local data folders...... it can be expanded to include many more of the etf's and holders..... compares either dollar values or number of shares over a selected period of time of the selected etf to the security its placed on.....
[code:1:e3d58345a8]firstdate:=Input("first date mmddyyyy",111990,12312100,1032006);
amount:=Input("US dollar amount", 1,1000000,1000);
shares:=Input("number of shares",1,1000000,100);
choice:=Input(" 1 dollars or 2 shares",1,2,2);
etf:=Input("1 dia, 2 spy, 3 qqq",1,3,1);
a:=amount/C;
aa:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),a);
aaaa:=(aa*C)-amount;
b:=shares*C;
bb:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),b);
bbbb:=b-bb;
plot:=If(choice=1,aaaa,If(choice=2,bbbb,aaaa));
0;
plot;
{dia etf section, change the security to suit}
a:=amount/Security("C:\\MetaStock Data\\etf\\dia",C ) ;
aa:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),a);
aaaa:=(aa*Security("C:\\MetaStock Data\\etf\\dia",C ))-amount;
b:=shares*Security("C:\\MetaStock Data\\etf\\dia",C );
bb:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),b);
bbbb:=b-bb;
dia:=If(choice=1,aaaa,If(choice=2,bbbb,aaaa));
{spy etf section, change the security to suit}
a:=amount/Security("C:\\MetaStock Data\\etf\\spy",C ) ;
aa:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),a);
aaaa:=(aa*Security("C:\\MetaStock Data\\etf\\spy",C ))-amount;
b:=shares*Security("C:\\MetaStock Data\\etf\\spy",C );
bb:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),b);
bbbb:=b-bb;
spy:=If(choice=1,aaaa,If(choice=2,bbbb,aaaa));
{qqqq etf section, change the security to suit}
a:=amount/Security("C:\\MetaStock Data\\etf\\qqqq",C ) ;
aa:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),a);
aaaa:=(aa*Security("C:\\MetaStock Data\\etf\\qqqq",C ))-amount;
b:=shares*Security("C:\\MetaStock Data\\etf\\qqqq",C );
bb:=ValueWhen(1, firstDate=Month()*1000000 + DayOfMonth()*10000+ Year(),b);
bbbb:=b-bb;
qqqq:=If(choice=1,aaaa,If(choice=2,bbbb,aaaa));
If(etf=1,dia,If(etf=2,spy,If(etf=3,qqqq,dia)));[/code:1:e3d58345a8]
|