Programmazione Metastock Cerco aiuto per Metastock (1 Viewer)

chemizin

Nuovo forumer
Salve Raga...
chiedo scusa se chiederò qualcosa di ripetitivo mediante questo 3d, ma credo di aver rivoltato il forum senza trovare quello che cercavo.

C'è qualcuno che utilizza Metastock, che può aiutarmi?

Grazie a tutti
 

chemizin

Nuovo forumer
Che aiuto ti serve?

Grazie Arosa...
ho iniziato da poco ad utilizzare Metastock (prima utilizzavo altro software). Non riesco a scrivere la formula per una benedetta MM centrata e la formula della sua velocità.:wall: Volevo sapere se qualcuno (che utilizza questi indicatori ciclici ovviamente) è riuscito a svilupparli.
 

Arosa

Forumer attivo
Grazie Arosa...
ho iniziato da poco ad utilizzare Metastock (prima utilizzavo altro software). Non riesco a scrivere la formula per una benedetta MM centrata e la formula della sua velocità.:wall: Volevo sapere se qualcuno (che utilizza questi indicatori ciclici ovviamente) è riuscito a svilupparli.[/QUOTE

Non so se ci riesco ci provo dammi qualche giorno.
 

Arosa

Forumer attivo
Ne ho trovato un paio vedi se ti possono servire.
Al momento non ho sottomano Metastock e non ho potuto controllare fammi sapere.
{ User inputs }
pds:=Input("MA periods",1,2600,9);
type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,
1);

{ Choose MA type:
1 - Exponential MA
2 - Simple MA
3 - Time Series MA
4 - Triangular MA
5 - Variable MA
6 - Volume adjusted MA
7 - Weighted MA }
ma:=
If(type=1,Mov(C,pds,E),
If(type=2,Mov(C,pds,S),
If(type=3,Mov(C,pds,T),
If(type=4,Mov(C,pds,TRI),
If(type=5,Mov(C,pds,VAR),
If(type=6,Mov(C,pds,VOL),
Mov(C,pds,W)))))));

{ Forward-reference MA }
center:=LastValue(Int(pds/2));
fwd:=Ref(ma,center);

{ Extend plot into null zone } xtend:=LastValue(fwd+PREV-PREV);

{ Restrict invalid initial MA } ma:=Ref(Ref(xtend,pds-1),-pds+1);

{ Plot on price chart }
-----------------------------------------------------------------------------------------------------------------------------------------------


Moving Average - Centered
{ Centered Moving Average - v3.0 }
{ Uses forward-referencing to center Mov Avg
and project future direction.}
{ Uses hindsight - do not trade! }
{ CCopyright 2005 Jose Silva
For personal use only.
http://www.metastocktools.com }
{ User inputs }
fwPds:=Input("Forward-referencing periods (automatic = -1)",-1,2600,-
1);
proj:=Input("Project last known MA: [1]Direction, [2]Value",1,2,1);
pds:=Input("Mov Avg periods",1,2600,21);
type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,
2);
{ Choose MovAvg type:
1 - Exponential MA
2 - Simple MA
3 - Time Series MA
4 - Triangular MA
5 - Variable MA
6 - Volume adjusted MA
7 - Weighted MA }
ma:=
If(type=1,Mov(C,pds,E),
If(type=2,Mov(C,pds,S),
If(type=3,Mov(C,pds,T),
If(type=4,Mov(C,pds,TRI),
If(type=5,Mov(C,pds,VAR),
If(type=6,Mov(C,pds,VOL),
Mov(C,pds,W)))))));
{ Automatic period-centering }
center:=LastValue(If(fwPds<0,Int(pds/2),fwPds));
{ Forward-referenced MovAvg }
fwd:=Ref(ma,center);
{ Last valid MovAvg plot point }
lastVal:=IsUndefined(fwd)
AND Alert(IsUndefined(fwd)=0,2);
{ Extend MovAvg plot into future null zone }
xtend:=LastValue(fwd+PREV-PREV);
{ Restrict invalid initial MovAvg plot }
movAvg:=Ref(Ref(xtend,pds-1),-pds+1);
{ Last MA known direction & future projection }
init:=Cum(IsDefined(movAvg))=1;
direction:=movAvg+
( ValueWhen(1,init OR lastVal,Ref(movAvg,-1))
-ValueWhen(1,init OR lastVal,Ref(movAvg,-2)))
*(BarsSince(init OR lastVal)+1);
{ Plot MovAvg on price chart }
If(proj=1,direction,movAvg)

-------------------------------------------------------------------------------------------------------------------------------------------------



Moving Average - Centered
{ Centered Moving Average v4.0 }
{ Uses forward-referencing to center Mov Avg and project future direction.}
{ Uses hindsight - do not trade! }
{ CCopyright 2005 Jose Silva. For personal use only.
http://www.metastocktools.com }
{ User inputs }
fwPds:=Input("Forward-referencing periods (automatic = -1)",-1,2600,-
1);
proj:=Input("Project last known MA: [1]Direction, [2]Value",1,2,1);
pds:=Input("Mov Avg periods",1,2600,21);
channel:=Input("Channel +/- boundary %",
0,1000,5)/100;
type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,
2);
{ Choose MovAvg type:
1 - Exponential MA
2 - Simple MA
3 - Time Series MA
4 - Triangular MA
5 - Variable MA
6 - Volume adjusted MA
7 - Weighted MA }
ma:=
If(type=1,Mov(C,pds,E),
If(type=2,Mov(C,pds,S),
If(type=3,Mov(C,pds,T),
If(type=4,Mov(C,pds,TRI),
If(type=5,Mov(C,pds,VAR),
If(type=6,Mov(C,pds,VOL),
Mov(C,pds,W)))))));
{ Automatic period-centering }
center:=LastValue(If(fwPds<0,Int(pds/2),fwPds));
{ Forward-referenced MovAvg }
fwd:=Ref(ma,center);
{ Last valid MovAvg plot point }
valid:=Cum(IsDefined(fwd))
=LastValue(Cum(IsDefined(fwd)));
valid:=valid AND Alert(valid=0,2);
{ Extend last MovAvg plot to future null zone }
xtend:=LastValue(fwd+PREV-PREV);
{ Restrict invalid initial MovAvg plot }
movAvg:=Ref(Ref(xtend,pds-1),-pds+1);
{ Last MA known direction & future projection }
init:=Cum(IsDefined(movAvg))=1;
direction:=movAvg+
If(IsUndefined(fwd),
ValueWhen(1,init OR valid,movAvg)-
ValueWhen(1,init OR valid,Ref(movAvg,-1)),0)
*BarsSince(init OR valid);
{ Choose Centered MovAvg type }
CMA:=If(proj=1,direction,movAvg);
{ Plot MovAvg on price chart }
If(BarsSince(valid),CMA,CMA)*(1+channel);
If(BarsSince(valid),CMA,CMA)*(1-channel);
CMA
 

Arosa

Forumer attivo
Forse questa e quella piu giusta.

Here is an indicator that compliments the channel plot. It’s derived from Brian Millard’s book “Channels & Cycles: A Tribute To J.M Hurst”. Have attached a screenshot straight from general use to show you how it might plot…you’re looking at the indicator with green and grey lines – which correspond to the two channels.



This basically will highlight completed/historical cycles on a fixed zero-reference (if you get the periodicity right). Try playing around with it….eyeball the peaks and troughs for a given approximate wavelength and then measure the average number of bars for recent full cycles using the MS Cycle Lines tool overlaid on the indicator plot. Then fine tune the input to the indicator based on what you measure. Trial and error should get you somewhere. Overlay a couple of plots for two major cycles and see what you see…



Of course there is the ever-present null plot at the right hand edge, so comments in earlier post applies. The N/A plot is double what it would be for a plot of the equivalent CMA channel due to the fact that 2 MAs are used in this one, one with double the length. Therefore plot in conjunction with channel. You can also create a similar indicator with Simple MAs and overlay that (I plot the Triangular version as a bold line and the Simple as a light one)…this has less N/A plot as it doesn’t need the 1.5 factor but is consequently more erratic due to less smoothing. Gives you a bit more info though.



This one is a case of swings and roundabouts really…just another way of looking at what a CMA is telling you, but I find it visually very useful for determining if there is a strong cyclic component and what the average wavelength of it is. Allows me to define time periods when I should be looking for cycle tops and bottoms to occur if the symmetry holds up. Or, put another way, gives me an idea of when I should *not* be looking for tops/bottoms, which is equally as important!



Bear in mind of course that there is variation in wavelength all the time, so don’t try banging your head against it trying to get a smooth plot like a sine wave…that would be far too easy!!



Anyway, what the attached plot of GBP/USD spot is telling me now is that we may be approaching a cyclical top this week as shown by the grey cycle line. However…the longer-term green cycle has only just bottomed. Conclusion – take some long profits first and then secondly take the rest & go short if a set-up shows itself with confirmation on shorter time frames… but do so with care and stay alert for possibility of up-trend re-establishing until end Jan/early Feb (when green cycle estimated to top).



Note… there is more to my trading strategy than this and so this is NOT a trade recommendation!!!...just showing you the line of thinking that goes with these particular indicators.



Andy



PS, don’t ask me how I got the buy/sell arrows on the plot please…I won’t tell !!



------



{Cycle Highlighter}



{USE TO ISOLATE SPECIFIC WAVELENGTHS}

{Difference between two Centred Tri MAs

second MA is half periodicity of first

- as per p.176 of Millard: Channels and Cycles}

{odd period values in MA to ensure there is a valid centre reference bar}



{Periods}

P1:=Input("Cycle Wavelength",3,10000,207);

X:=Input("NB, periods in Tri MA = wavelength * 1.5",0,0,0);

P1:=Int(P1*1.5);

P1:=LastValue(If(Frac(P1/2)=0,P1+1,P1));

P2:=Int(p1/2);

P2:=LastValue(If(Frac(P2/2)=0,P2+1,P2));



{Moving Averages}

MA1:=Mov(P,P1,TRI);

MA2:=Mov(P,P2,TRI);



{Centre MAs}

PC1:=LastValue((P1-1)/2);

PC2:=LastValue((P2-1)/2);

CMA1:=Ref(MA1,PC1);

CMA2:=Ref(MA2,PC2);



{Plot}

cyhi:=CMA2-CMA1;



0;cyhi
 

Arosa

Forumer attivo
Altrimenti fai una ricerca con Google inserendo CMA+Metastock ci sono tante cose interessanti.
Saluti
 

chemizin

Nuovo forumer
Altrimenti fai una ricerca con Google inserendo CMA+Metastock ci sono tante cose interessanti.
Saluti

Grazie Arosa...apprezzo tantissimissimo!
alcune le avevo trovate anch'io di quelle che hai riportato. La più interessante è l'ultima che è il calcolo di un indicatore di ciclo di Hurst (differenza tra due medie mobili centrate)...provo a scremare ciò che mi interessa da quest'ultimo listato.

Spero di poter contraccambiare quando avrai bisogno tu.
Saluti
Max
 

Users who are viewing this thread

Alto