Hello,
good day everyone. I found this Trading System in my archive, and I would like to test it, but Tradestation 2000i reports errors.
The formula of the T.S. it's the following:

If adx(Per) <> 0 and adx(Per)[Length] <> 0 Then begin
value1 = (absvalue(ADX(Per) - ADX(Per)[Length])/ADX(Per)[Length])*100;

if Average(C, per2)[Length] <> 0 and Average(C, Per2) <> 0 then
value2 = (absvalue(Average(C, Per2)-Average(C, per2)[Length])/ Average(C, per2)[Length])*100;

if Average(C, per3)[Length] <> 0 and Average(C, Per3) <> 0 then
value3 = (absvalue(Average(C, Per3)-Average(C, per3)[Length])/ Average(C, per3)[Length])*100;

if value1 > value1[1]*3 Then Begin
if value2 > value3 and MACD(C, 10, 25) < Ave then Buy next bar {Highest(H, 5) Limit}O;
if value2 < value3 and MACD(C, 10, 25) > Ave Then Sell next bar {Lowest(L, 5) Limit}O;
end;

end
else value1 = 0;

if Marketposition = 1 and MACD(C, 10, 25) > Ave Then ExitLong ("LX") next bar at market;
if Marketposition = -1 and MACD(C, 10, 25) < Ave Then Exitshort ("SX") next bar at market;

If adx(Per) <> 0 and adx(Per)[Length] <> 0 Then begin
value1 = (absvalue(ADX(Per) - ADX(Per)[Length])/ADX(Per)[Length])*100;

if Average(C, per2)[Length] <> 0 and Average(C, Per2) <> 0 then
value2 = (absvalue(Average(C, Per2)-Average(C, per2)[Length])/ Average(C, per2)[Length])*100;

if Average(C, per3)[Length] <> 0 and Average(C, Per3) <> 0 then
value3 = (absvalue(Average(C, Per3)-Average(C, per3)[Length])/ Average(C, per3)[Length])*100;

if value1 > value1[1]*3 Then Begin
if value2 > value3 and MACD(C, 10, 25) < Ave then Buy next bar {Highest(H, 5) Limit}O;
if value2 < value3 and MACD(C, 10, 25) > Ave Then Sell next bar {Lowest(L, 5) Limit}O;
end;

end
else value1 = 0;

if Marketposition = 1 and MACD(C, 10, 25) > Ave Then sell ("LX") next bar at market;
if Marketposition = -1 and MACD(C, 10, 25) < Ave Then buytocover ("SX") next bar at market;

The following 3 users say Thank You to kevinkdog for this post: