Hi,
I appreciate your assistance. Would you mind showing me how I can edit my existing standard code in Tradestation included below with your suggestion?
Again, I would greatly appreciate it. Unfortunately, not a programmer even at this basic level.
My Code from Tradestation standard 3 averages:
inputs:
Price( Close ),
FastLength( 4 ),
MedLength( 9 ),
SlowLength( 18 ),
Displace( 0 ) ;
variables:
FastAvg( 0 ),
MedAvg( 0 ),
SlowAvg( 0 ) ;
FastAvg = AverageFC( Price, FastLength ) ;
MedAvg = AverageFC( Price, MedLength ) ;
SlowAvg = AverageFC( Price, SlowLength ) ;
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then
begin
Plot1[Displace]( FastAvg, "FastAvg" ) ;
Plot2[Displace]( MedAvg, "MedAvg" ) ;
Plot3[Displace]( SlowAvg, "SlowAvg" ) ;
{ Alert criteria }
if Displace <= 0 then
begin
Condition1 = Price > FastAvg and FastAvg > MedAvg and MedAvg > SlowAvg ;
if Condition1 and Condition1[1] = false then
Alert( "Bullish alert" )
else
begin
Condition2 = Price < FastAvg and FastAvg < MedAvg and MedAvg < SlowAvg ;
if Condition2 and Condition2[1] = false then
Alert( "Bearish alert" ) ;
end ;
end ;
end ;