I have two Tradestation scripts that I am attempting to convert to Esignal efs scripts.
I will post the scripts in separate messages. The first is as follows:
***********************
{efs script request 1}
Inputs: Price((H+L+C+O)/4), Length(10), Const(2),Displace(1),OutsideUp(magenta),OutsideDwn (magenta);
Variables: Avg(0), UpperK(0), LowerK(0), AbsDisp(0);
Avg = Average(Price, Length);
UpperK = KeltnerChannel(Price, Length, Const);
LowerK = KeltnerChannel(Price, Length, -Const);
If Displace >= 0 OR CurrentBar > AbsValue(Displace) Then Begin
Plot1[Displace](UpperK, "B_Upper");
Plot3[Displace](LowerK, "B_Lower");
if plot1>plot1[1] then SetPlotColor(1,OutsideUp);
if plot1<plot1[1] then SetPlotColor(1,OutsideDwn);
if plot1=plot1[1] and plot1[1]>plot1[2] then SetPlotColor(1,OutsideUp);
if plot1=plot1[1] and plot1[1]<plot1[2] then SetPlotColor(1,OutsideDwn);
if plot3>plot3[1] then SetPlotColor(3,OutsideUp);
if plot3<plot3[1] then SetPlotColor(3,OutsideDwn);
if plot3=plot3[1] and plot3[1]>plot3[2] then SetPlotColor(3,OutsideUp);
if plot3=plot3[1] and plot3[1]<plot3[2] then SetPlotColor(3,OutsideDwn);
end;
inputs: Price1((H+L+C+O)/4 ), Length1( 2 ), Displace1( 1.25 ) ;
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot4[Displace1]( AverageFC( Price1, Length1 ), "Avg" ) ;
{ Alert criteria }
if Displace <= 0 then
begin
if Price > Plot1 and Plot1 > Plot1[1] and Plot1[1] <= Plot1[2] then
Alert( "Indicator turning up" )
else if Price < Plot1 and Plot1 < Plot1[1] and Plot1[1] >= Plot1[2] then
Alert( "Indicator turning down" ) ;
end ;
end ;
*********************************
Thanks,
DaTr8dr
I will post the scripts in separate messages. The first is as follows:
***********************
{efs script request 1}
Inputs: Price((H+L+C+O)/4), Length(10), Const(2),Displace(1),OutsideUp(magenta),OutsideDwn (magenta);
Variables: Avg(0), UpperK(0), LowerK(0), AbsDisp(0);
Avg = Average(Price, Length);
UpperK = KeltnerChannel(Price, Length, Const);
LowerK = KeltnerChannel(Price, Length, -Const);
If Displace >= 0 OR CurrentBar > AbsValue(Displace) Then Begin
Plot1[Displace](UpperK, "B_Upper");
Plot3[Displace](LowerK, "B_Lower");
if plot1>plot1[1] then SetPlotColor(1,OutsideUp);
if plot1<plot1[1] then SetPlotColor(1,OutsideDwn);
if plot1=plot1[1] and plot1[1]>plot1[2] then SetPlotColor(1,OutsideUp);
if plot1=plot1[1] and plot1[1]<plot1[2] then SetPlotColor(1,OutsideDwn);
if plot3>plot3[1] then SetPlotColor(3,OutsideUp);
if plot3<plot3[1] then SetPlotColor(3,OutsideDwn);
if plot3=plot3[1] and plot3[1]>plot3[2] then SetPlotColor(3,OutsideUp);
if plot3=plot3[1] and plot3[1]<plot3[2] then SetPlotColor(3,OutsideDwn);
end;
inputs: Price1((H+L+C+O)/4 ), Length1( 2 ), Displace1( 1.25 ) ;
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot4[Displace1]( AverageFC( Price1, Length1 ), "Avg" ) ;
{ Alert criteria }
if Displace <= 0 then
begin
if Price > Plot1 and Plot1 > Plot1[1] and Plot1[1] <= Plot1[2] then
Alert( "Indicator turning up" )
else if Price < Plot1 and Plot1 < Plot1[1] and Plot1[1] >= Plot1[2] then
Alert( "Indicator turning down" ) ;
end ;
end ;
*********************************
Thanks,
DaTr8dr
Comment