logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
swordman  
#1 Posted : Wednesday, April 12, 2006 7:50:29 AM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

Wish list in future version of MS . I wish MS could combine some basic statistic function within it . For example , how many percentage of the price can go up/down after it cross a 10 bars SMA line before it drop/rise back again . If MS can draw us a probability distribution for us , it could be more easier for us to set up our trading target . Thanks .
Jose  
#2 Posted : Wednesday, April 12, 2006 10:18:01 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Swordman, try using the available MS tools wherever possible. Here's some code based on your example: [code:1:03cc1969a3] ========= Up/Down % ========= ---8<------------------------------------ { Probability distribution indicator v1.0 Measures percentage of Up [+] and Down [-] bars within trade periods. ©Copyright 2006 Jose Silva. For personal use only. http://www.metastocktools.com } { User inputs } pds1:=Input("SMA entry periods",2,260,10); pds2:=Input("SMA exit periods",2,260,10); plot:=Input("[1]Probability distribution, [2]Up/Down signals",1,2,1); { Trade conditions } entry:=Cross(C,Mov(C,pds1,S)); exit:=Cross(Mov(C,pds2,S),C); { Trade period } init:=Cum(IsDefined(entry+exit))=1; trade:=ValueWhen(1,entry-exit<>0 OR init,entry); { Up/Down bars within trade periods } up:=C>Ref(C,-1) AND trade; down:=C<Ref(C,-1) AND trade; total:=Max(Cum(trade),.00001); { Up/Down percentages within trade periods } upPer:=Cum(up)/total*100; downPer:=Cum(down)/total*100; { Plot in own window } If(plot=1,upPer,trade*.5); If(plot=1,-downPer,up-down) ---8<------------------------------------ [/code:1:03cc1969a3] jose '-)
swordman  
#3 Posted : Friday, April 14, 2006 8:18:34 AM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

Dear Jose : Very thanks for your concern and reply but maybe I did not make myself clear . I tried your formula but that was not what I needed . I would like to have a probability bell shape distribution graph just like the graph you see in the statistic book not not a indicator which overlay in the candle chart of metastock . The things I need it . To count each even , for example , the close price on Dow Jones index cross its 20days sma on 10 Mar 2006 and it was 11076 and it drop below the 20 days sma again on 31 Mar 2006 . The close price which it went most was on 22 Mar 06 , close at 11317 (not include the highest high price on 21 Mar 06 ) . Then the magnitude it goes after it cross the 20 SMA was 11317/11076 ~= 2.1759% . Count this 2.1759% as a single event and plot all the events , say in the past ten years , into a probability distribution bell shape graph . In addition , the negative magnitude should also be counted too . For the above date and case . The negative magnitude was zero as it did not drop below the signal date before it drop below the 20 days sma . Maybe it was called maximum adverse/favourable excursion in others TA software . What ever it is called , I really wish metastock could combine this kind of function in the system tester to let the users to visualize the all the events . It help us to decide how much we should take profit and how much we should suffer before we cut lost . Thanks Jose and equis again .
swordman  
#4 Posted : Friday, April 14, 2006 8:21:48 AM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

:mrgreen: forgot to say , dear Jose : Happy Easter holiday !! We have four days public holiday in my country . For this issue , is there any way to output something from metastock such as the equity line of system tester in MS to SPSS ver 11 to do it ? I have SPSS .
Jose  
#5 Posted : Friday, April 14, 2006 10:23:08 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
I've got no idea what SPSS is. Happy Easter holiday, Swordman. jose '-)
StorkBite  
#6 Posted : Friday, April 14, 2006 10:58:23 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
You could export the data from the indicator into Excel and copy the cell values straight into SPSS. From there, it's all uphill! :) Just right click the price line and select COPY. Then PASTE into an empty worksheet.... I'm not in front of SPSS at the moment, but you should be able to paste straight into it and bypass Excel.
wabbit  
#7 Posted : Friday, April 14, 2006 11:24:47 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Here's the MS formula for the differences: ma:=Mov(C,20,S); Up:=C>ma; Dn:=C<ma; x:=Up-Dn; y:=ROC(x,1,$); pCh:=ValueWhen(1,y<>0,C); sUp:=If(x>0,100*(C-pCh)/pCh,0); sDn:=If(x<0,100*(C-pCh)/pCh,0); sUp; {colour me green} sDn; {colour me red} I suppose the next step will be to export this function (which is actually two lines) into Excel and simply use the histogram function there to do the analysis. If you need any more help, just ask. wabbit :D P.S. Remember MetaStock is a charting technical analysis tool, not a statistics package.
swordman  
#8 Posted : Saturday, April 15, 2006 3:08:46 PM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

woh~~ what a forum with love and care ! ^_* Thanks wabbit , let me try it . I think technical analysis is based on how we can get a good result from the past . If we can get some basic statistics , then we can make more precise exit position . Actually it is just something like maxumum favourable excursion . What I wish is to have a function in MS system tester to visualize the result into a graph only . thanks again Wabbit .
StorkBite  
#9 Posted : Saturday, April 15, 2006 11:40:04 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Swordman- Did you figure out that this can be done in SPSS? In v12, open a new database from the main menu using 'TYPE IN DATA'. Then you can paste the equity line indicator data directly into a variable column and run whatever statistical functions you have available. If you are interested in peak excursions, you might check out this indicator: http://forum.equis.com/viewtopic.php?t=3617
swordman  
#10 Posted : Tuesday, April 18, 2006 8:36:23 AM(UTC)
swordman

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/10/2006(UTC)
Posts: 42
Location: Hong Kong

thanks very much , q_stockman . I will take a look for the link . I am not very familiar with SPSS . Mr wabbit have done a great great job for what I wanted to do . That is almost exactly what I wanted but it show a continous line only . It maybe even better if it can be more simply shown us a favorable excursion graph . I can export the line of Mr Wabbit did to an excel or SPSS but I am still thinking how to 'excerpt' the maximum value (that is the most percent of how far it can go after it cross the line ) of each event when it cross and drop under it again . Is there anyway it can be done in excel ? I know nothing about excel macro ....sorry . :|
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.