Trading System: improve it with 3 Exit - futures io
futures io futures trading



Trading System: improve it with 3 Exit


Discussion in EasyLanguage Programming

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Trading System: improve it with 3 Exit

(login for full post details)
  #1 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received

Good morning,

in my archive, I found this Trading System, and the author recommended to do tests with 3 Exit, to improve the efficiency and robustness of the T.S.
If someone could kindly transform the 3 Exit into Easylanguage and insert them into the formula, which I will try one at a time with the use of parentheses: { }.

These are the 3 Exit to be included in the formula; I will also turn them into: (after SellShort): Exit ....:


(after Buy): Exit with a profit after 30 bars, if the closing is less than the exponential moving average of 5 days.
(after Buy): Exit with a limit order if the open profit exceeds 20%.
(after Buy): Exit with a profit if the trade lasts for more than 50 bars.


This is the formula of the T.S. for Tradestation 8 or higher:
-----------------------------------------------------------------

Inputs: length(30), MaxEntryLB(60), MinEntryLB(20), MaxExitLB(30), MinExitLB(10);
Vars: HistVol(O), YestHistVol(O), DeltaHistVol(O), EntryLB(O), ExitLB(O),
YestEntryLB(O), YestExitLB(O);

YestHistVol = HistVol;
HistVol = StdDev(C, length);
DeltaHistVol = (HistVol-YestHistVol) / HistVol;
If CurrentBar = 1 Then EntryLB = 20;
YestEntryLB = EntryLB;
EntryLB = YestEntryLB * (1 + DeltaHistVol);
EntryLB = MaxList(EntryLB, MinEntryLB);
EntryLB = MinList(EntryLB, MaxEntryLB);
YestExitLB = ExitLB;
ExitLB = YestExitLB * (1 - DeltaHistVol);
ExitLB = MinList(ExitLB, MaxExitLB);
ExitLB = MaxList(ExitLB, MinExitLB);
Buy next bar at Highest(High, EntryLB) Stop;
Sellshort next bar at Lowest(Low, EntryLB) Stop;
Sell next bar at Lowest(Low, ExitLB) Stop;
Buytocover next bar at Highest(High, ExitLB) Stop;
Setstoploss(1500);

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

I thank you in advance for your collaboration.

Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(170 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Houston Texas
 
 
Posts: 14 since Dec 2019
Thanks: 6 given, 10 received


Only after buy? Not after entering a short position?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received


Tom1978 View Post
Only after buy? Not after entering a short position?

Hi,
yes, of course, also Sellshort (I would have done it , for not to disturb you too much).
Thank you very much.

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

{after Buy}: Exit with a profit after 30 bars, if the closing is less than the exponential moving average of 5 days.
{after Sellshort}: Exit with a profit after 30 bars, if the closing is higher than the exponential moving average of 5 days.

{after Buy}: Exit with a limit order if the open profit exceeds 20%.
{after Sellshort}: Exit with a limit order if the open profit exceeds 20%.

{after Buy}: Exit with a profit if the trade lasts for more than 50 bars.
{after Sellshort}: Exit with a profit if the trade lasts for more than 50 bars.

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

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Houston Texas
 
 
Posts: 14 since Dec 2019
Thanks: 6 given, 10 received

Something like this?

{after Buy}: Exit with a profit after 30 bars, if the closing is less than the exponential moving average of 5 days.
What do you do your trade is profitable after 30 bars, but closing > mov avg 5 days?

{after Sellshort}: Exit with a profit after 30 bars, if the closing is higher than the exponential moving average of 5 days.

{after Buy}: Exit with a limit order if the open profit exceeds 20%.
You can use setprofittarget, but what is the 20%? 20% of what?

{after Sellshort}: Exit with a limit order if the open profit exceeds 20%.

{after Buy}: Exit with a profit if the trade lasts for more than 50 bars.
if marketposition = 1 and barssinceentry = 50 and close>entryprice then sell this bar at close; //market order
or
if marketposition = 1 and barssinceentry = 50 then sell next bar at entryprice limit; //limit order
And what are you going to do if the trade is not profitable after 50 bars?

{after Sellshort}: Exit with a profit if the trade lasts for more than 50 bars.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received

For Tom 1978,

You have a PM.

Reply With Quote
 
(login for full post details)
  #7 (permalink)
Houston Texas
 
 
Posts: 14 since Dec 2019
Thanks: 6 given, 10 received


Shaban View Post
For Tom 1978,

You have a PM.

You've got one too!

All the best,
Tom

Reply With Quote
The following user says Thank You to Tom1978 for this post:
 
(login for full post details)
  #8 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received

Hi Tom,

You have another P.M.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received

If it may be useful to someone, I insert here the 3 Exit translated in Esylanguage (thanks to Tom 1978):

If marketposition=1 and close>entryprice and barssinceentry=30 and close<xaverage(close,5) then Sell("LX 30") next bar at market;
If marketposition=-1 and close<entryprice and barssinceentry=30 and close>xaverage(close,5) then Buytocover("SX 30") next bar at market;

If marketposition=1 and close>1.20*Entryprice then Sell("LX target") this bar at close;
If marketposition=-1 and close<0.8*Entryprice then Buytocover("SX target") this bar at close;

If marketposition=1 and close>entryprice and barssinceentry=50 then Sell("LX 50") this bar at close;
If marketposition=-1 and close<entryprice and barssinceentry=50 then Buytocover("SX 50") this bar at close;

Reply With Quote
The following user says Thank You to Shaban for this post:
 
(login for full post details)
  #10 (permalink)
Houston Texas
 
 
Posts: 14 since Dec 2019
Thanks: 6 given, 10 received


Hi Shaban,

Did the 3 additional exits work the way you want them to?

Tom

Reply With Quote
 
(login for full post details)
  #11 (permalink)
Turin + Italy
 
 
Posts: 83 since Feb 2020
Thanks: 11 given, 58 received


Tom1978 View Post
Hi Shaban,

Did the 3 additional exits work the way you want them to?

Tom

Hi, Tom,

unfortunately the 3 Exits, allow the T.S. an over-optimization, because the T.S. always chooses the best solution.
An example: by inserting the Exit with a profit if the trade lasts more than 50 bar:

If marketposition=1 and close>entryprice and barssinceentry=50 then Sell("LX 50") this bar at close;
If marketposition=-1 and close<entryprice and barssinceentry=50 then Buytocover("SX 50") this bar at close;

the T.S. already before 50 bars will signal the Exit in profit, while subsequently, if the trend will continue beyond 50 bars, the T.S. will choose this last Exit, no longer signaling the previous Exit.

There is an interesting message for you.

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Trading System: improve it with 3 Exit


Last Updated on February 26, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts