龙听期货论坛's Archiver

C
+
+


 微信: QQ:

龙听 发表于 2022-11-2 12:50

【RSIClassic】

[code]Inputs: PriceValue(NumericSeries),Len(NumericSimple);
Variables: var0(0), var1(0), var2(0), var3(0), var4(0), var5(0),  var6(0),var7(0);

var7 = Len;
var3 = 0;
var4 = 0;  

For var0 = 0 To var7-1 Begin
        var2 = PriceValue[var0] - PriceValue[var0 + 1];
        If var2 >= 0 Then
                var1 = 0
        Else Begin
                var1 = -var2;
                var2 = 0;
        End;
        var3 = var3 + var2;
        var4 = var4 + var1;
End;
var5 = var3 / var7;
var6 = var4 / var7;

condition1 = var5+var6 <> 0 ;
If condition1 Then
        RSIClassic = 100 * var5 / (var5 + var6)
Else
        RSIClassic = 0;
[/code]

页: [1]