need conversion of amibroker code to metastock code

#1
can anybody convert following amibroker code to metastock code ?

_SECTION_BEGIN("Stochastic %K %D");
periods = Param( "Periods", 8, 1, 2000, 1 );//156
Ksmooth = Param( "%K avg", 3, 1, 2000, 1 );//72
Dsmooth = Param( "%D avg", 4, 1, 2000, 1 );//12
tf = Param( "TF", 6, 1, 375, 1 );

TimeFrameSet(in1Minute*tf );
k0=StochK( periods , Ksmooth);
d0=StochD( periods , Ksmooth ,Dsmooth);
TimeFrameRestore();

k=TimeFrameExpand( k0, in1Minute*tf,expandFirst );//expandLast
d=TimeFrameExpand( d0, in1Minute*tf,expandFirst );//expandLast

Plot( k,"%K :", ParamColor( "%K Color", colorLime ), ParamStyle("Style") );
Plot( d,"%D :", ParamColor( "%D Color", colorRed), ParamStyle("Style") );
Plot( TF, "TF :", colorBlack);
diffstoch = k - d;



_SECTION_BEGIN("Ribbon");
barht = Param("Barht", 2, 1, 100, 1) ;
Clrup = ParamColor("Color +ve", colorLime) ;
Clrdn = ParamColor("Color -ve", colorRed) ;
rclr = diffstoch;
clr = IIf(rclr > 0, Clrup, Clrdn);
Plot(barht, "", clr, styleArea|styleNoLabel|styleOwnScale, 0, 100) ;
_SECTION_END();
 

KelvinHand

Well-Known Member
#2
can anybody convert following amibroker code to metastock code ?

_SECTION_BEGIN("Stochastic %K %D");
periods = Param( "Periods", 8, 1, 2000, 1 );//156
Ksmooth = Param( "%K avg", 3, 1, 2000, 1 );//72
Dsmooth = Param( "%D avg", 4, 1, 2000, 1 );//12
tf = Param( "TF", 6, 1, 375, 1 );

TimeFrameSet(in1Minute*tf );
k0=StochK( periods , Ksmooth);
d0=StochD( periods , Ksmooth ,Dsmooth);
TimeFrameRestore();

k=TimeFrameExpand( k0, in1Minute*tf,expandFirst );//expandLast
d=TimeFrameExpand( d0, in1Minute*tf,expandFirst );//expandLast

Plot( k,"%K :", ParamColor( "%K Color", colorLime ), ParamStyle("Style") );
Plot( d,"%D :", ParamColor( "%D Color", colorRed), ParamStyle("Style") );
Plot( TF, "TF :", colorBlack);
diffstoch = k - d;



_SECTION_BEGIN("Ribbon");
barht = Param("Barht", 2, 1, 100, 1) ;
Clrup = ParamColor("Color +ve", colorLime) ;
Clrdn = ParamColor("Color -ve", colorRed) ;
rclr = diffstoch;
clr = IIf(rclr > 0, Clrup, Clrdn);
Plot(barht, "", clr, styleArea|styleNoLabel|styleOwnScale, 0, 100) ;
_SECTION_END();
I don't think anybody can solve the Multiple Time Frame issue in metastock till today.

So don't expect any help for conversion.
 

KelvinHand

Well-Known Member
#4
from my understanding so far, there are no functions in metastock that can do the conversion of amibroker functions like TimeFrameSet(), TimeFrameExpand() for different timeframe.

so how to do ?
 

Similar threads