龙听期货论坛's Archiver

龙听 发表于 2022-11-1 11:16

【ADXRCustomClassic】

[code]Inputs: HPriceValue(NumericSeries), LPriceValue(NumericSeries),CPriceValue(NumericSeries), MyRange (NumericSimple);
Variables  : var0(0) ;

var0 = 0 ;
If CurrentBar < MyRange Then Begin
        If CurrentBar = 1        Then
                var0 = ADXCustom(HPriceValue, LPriceValue, CPriceValue, MyRange)
        Else
                var0 = (ADXCustomClassic(HPriceValue, LPriceValue, CPriceValue, MyRange) + ADXCustom(HPriceValue, LPriceValue, CPriceValue, MyRange)[CurrentBar]) * .5;
End
Else
        var0 = (ADXCustomClassic(HPriceValue, LPriceValue, CPriceValue, MyRange) + ADXCustom(HPriceValue, LPriceValue, CPriceValue, MyRange)[MyRange-1 ]) * .5;

ADXRCustomClassic = IntPortion(var0);
[/code]

页: [1]