以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 求助交易开拓者指标转成金字塔语言,十分感谢! (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=140508) |
-- 作者:唐方一战 -- 发布时间:2016/10/10 13:45:13 -- 求助交易开拓者指标转成金字塔语言,十分感谢! 老师你好,我有一个交易开拓者的指标,想问问能否帮我转还成金字塔的,十分感谢! Params
Numeric Length(55) ;
Numeric OverSold(30) ;
Numeric OverBought(70) ; Vars
Numeric A;
Numeric B;
NumericSeries NetChgAvg( 0 );
NumericSeries TotChgAvg( 0 );
Numeric SF( 0 );
Numeric Change( 0 );
Numeric ChgRatio( 0 ) ;
NumericSeries RSIValue;
NumericSeries RSIMA;
//------------------------------------------
NumericSeries NetChgAvg1( 0 );
NumericSeries TotChgAvg1( 0 );
Numeric SF1( 0 );
Numeric Change1( 0 );
Numeric ChgRatio1( 0 ) ;
NumericSeries RSIValue1;
NumericSeries RSIMA1; Begin //----------------------DATA0--------------------------------------------------
If(CurrentBar <= Length - 1)
{
NetChgAvg = ( DATA0.Close - DATA0.Close[Length] ) / Length ;
TotChgAvg = Average( Abs( DATA0.Close - DATA0.Close[1] ), Length ) ;
}Else
{
SF = 1/Length;
Change = DATA0.Close - DATA0.Close[1] ;
NetChgAvg = NetChgAvg[1] + SF * ( Change - NetChgAvg[1] ) ;
TotChgAvg = TotChgAvg[1] + SF * ( Abs( Change ) - TotChgAvg[1] ) ;
}
If( TotChgAvg <> 0 )
{
ChgRatio = NetChgAvg / TotChgAvg;
}else
{
ChgRatio = 0 ;
}
RSIValue = 50 * ( ChgRatio + 1 );
RSIMA = Average(RSIValue,13); //----------------------------DATA1---------------------------------------------
If(CurrentBar <= Length - 1)
{
NetChgAvg1 = ( DATA1.Close - DATA1.Close[Length] ) / Length ;
TotChgAvg1 = Average( Abs( DATA1.Close - DATA1.Close[1] ), Length ) ;
}Else
{
SF1 = 1/Length;
Change1 = DATA1.Close - DATA1.Close[1] ;
NetChgAvg1 = NetChgAvg1[1] + SF1 * ( Change1 - NetChgAvg1[1] ) ;
TotChgAvg1 = TotChgAvg1[1] + SF1 * ( Abs( Change1 ) - TotChgAvg1[1] ) ;
}
If( TotChgAvg1 <> 0 )
{
ChgRatio1 = NetChgAvg1 / TotChgAvg1;
}else
{
ChgRatio1 = 0 ;
}
RSIValue1 = 50 * ( ChgRatio1 + 1 );
RSIMA1 = Average(RSIValue1,13);
A = data0.RSIMA;
B =data1.RSIMA1;
PlotNumeric(" A",A);
PlotNumeric(" B",B);
PlotNumeric("超买",OverBought);
PlotNumeric("超卖",OverSold); End |
-- 作者:jinzhe -- 发布时间:2016/10/10 13:54:18 -- 麻烦注释一下 |
-- 作者:唐方一战 -- 发布时间:2016/10/10 14:01:13 -- 我就是看不懂计算机语言,不好意思了 |
-- 作者:jinzhe -- 发布时间:2016/10/10 14:18:36 -- 这个是其他软件的计算语言,我们也无能为力 |