NexusFi: Find Your Edge


Home Menu

 





Trading System to be regularized


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,753 views
    2. thumb_up 3 thanks given
    3. group 0 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Trading System to be regularized

  #1 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

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:

-------------------------------------------------

Input: Per(30), Length(1), Per2(8), Per3(21);
Vars: Acceleraz1(false), Acceleraz2(false), ave(0);

Ave = XAverage(MACD(C, 10, 25), 10);

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 anyone can correct the formula, I thank you in advance.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
50 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
31 thanks

  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,645 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,336



Shaban View Post
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:

-------------------------------------------------

Input: Per(30), Length(1), Per2(8), Per3(21);
Vars: Acceleraz1(false), Acceleraz2(false), ave(0);

Ave = XAverage(MACD(C, 10, 25), 10);

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 anyone can correct the formula, I thank you in advance.


This modification verifies...



Input: Per(30), Length(1), Per2(8), Per3(21);
Vars: Acceleraz1(false), Acceleraz2(false), ave(0);

Ave = XAverage(MACD(C, 10, 25), 10);

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;

Follow me on Twitter Reply With Quote
The following 3 users say Thank You to kevinkdog for this post:
  #4 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

All right. Thank you very much.

Reply With Quote
  #5 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

Good morning,

to enter: Short with this formula for Tradestation 8 or higher, you need to modify this string as follows:

if value2 < value3 and MACD(C, 10, 25) > Ave Then Sellshort next bar {Lowest(L, 5) Limit}O;
end;

----------------------------------------------------

differences between Tradestation 2000i and Tradestation 8 or higher:

Tradestation 2000i: Sell
Tradestation 8: Sellshort

Tradestation 2000i: ExitLong("LX")
Tradestation 8: Sell

Tradestation 2000i: ExitShort("SX")
Tradestation 8: Buytocover

-----------------------------------------------------

Good continuation

Reply With Quote





Last Updated on February 11, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts