Hi all,
I've been trying to convert the following TradeStation EL code into EFS but I can't make it right. Could anyone please help me?
Thanks!
+++++
Inputs: Price(Close),Length(7),Kfactor(3),DFactor(3), OverBought(75), OverSold(25),ColorUp(blue),ColorDown(red),ColorUp2 (green),ColorDown2(Magenta);
Variables: RangeX(0),FastKX(0),SlowKX(0),SlowDx(0);
Value1 = Lowest(Low, Length);
Value2 = Highest(High, Length);
RangeX = Value2-Value1;
If RangeX>0 Then
FastKX = (Price-Value1)/RangeX*100
Else
FastKx=0;
SlowKX = XAverageEnsign(FastKX,Kfactor);
SlowDx = XAverageEnsign(SlowKX,Dfactor);
IF CurrentBar > Length Then Begin
{Plot1(SlowKX, "%K");}
Plot2(SlowDX, "%D");
End;
Plot3(OverBought, "OverBought");
Plot4(OverSold, "OverSold");
+++++
{************************************************* ******************
Description: XAverageEnsign (Function)
************************************************** ******************}
Inputs: Price(NumericSeries), Length(NumericSimple);
Variables: Factor(0);
If Length + 1 <> 0 Then Begin
If CurrentBar <= 1 Then Begin
Factor = 1/Length;
XAverageEnsign = Price;
End
Else
XAverageEnsign = Factor * Price + (1 - Factor) * XAverageEnsign[1];
End;
+++++
I've been trying to convert the following TradeStation EL code into EFS but I can't make it right. Could anyone please help me?
Thanks!
+++++
Inputs: Price(Close),Length(7),Kfactor(3),DFactor(3), OverBought(75), OverSold(25),ColorUp(blue),ColorDown(red),ColorUp2 (green),ColorDown2(Magenta);
Variables: RangeX(0),FastKX(0),SlowKX(0),SlowDx(0);
Value1 = Lowest(Low, Length);
Value2 = Highest(High, Length);
RangeX = Value2-Value1;
If RangeX>0 Then
FastKX = (Price-Value1)/RangeX*100
Else
FastKx=0;
SlowKX = XAverageEnsign(FastKX,Kfactor);
SlowDx = XAverageEnsign(SlowKX,Dfactor);
IF CurrentBar > Length Then Begin
{Plot1(SlowKX, "%K");}
Plot2(SlowDX, "%D");
End;
Plot3(OverBought, "OverBought");
Plot4(OverSold, "OverSold");
+++++
{************************************************* ******************
Description: XAverageEnsign (Function)
************************************************** ******************}
Inputs: Price(NumericSeries), Length(NumericSimple);
Variables: Factor(0);
If Length + 1 <> 0 Then Begin
If CurrentBar <= 1 Then Begin
Factor = 1/Length;
XAverageEnsign = Price;
End
Else
XAverageEnsign = Factor * Price + (1 - Factor) * XAverageEnsign[1];
End;
+++++
Comment