Exit Strategy after X-Bars taking in account Profit

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

Exit Strategy after X-Bars taking in account Profit

Postby geektrader » 04 Jan 2010

Hi,

today I wanted to share a exit strategy with you that has greatly improved overall performance for almost any system I am using. My recommendation is: add it to your existing trading-strategy and then use the Genetic Optimizer to find optimal values for both optimizable inputs for improving your Net Profit.

The strategy is pretty simply, but has boosted Net Profit for almost any of my strategies. It´s as simple as it can get, it exits a open position after X-Bars, but based on if the open position is in Profit or No Profit. This makes a huge difference compared to just existing after X-Bars and not taking into account if the position is in profit or not.

Give it a try and hope it improves your automatic trading as well:



Code: Select all

input: BarToExitOnProfit(240);
input: BarToExitOnNoProfit(240);

if positionprofit > 0 and BarsSinceEntry >= BarToExitOnProfit then begin
if MarketPosition = 1 Then Sell ( "TimeBarsProfitLX" ) next bar at market;
if MarketPosition = -1 Then   Buy To Cover ( "TimeBarsProfitSX" ) next bar at market;
   End;
   
if positionprofit < 0 and BarsSinceEntry >= BarToExitOnNoProfit then begin
if MarketPosition = 1 Then Sell ( "TimeBarsNoProfitLX" ) next bar at market;
if MarketPosition = -1 Then   Buy To Cover ( "TimeBarsNoProfitSX" ) next bar at market;
   End;

zukkaweb
Posts: 125
Joined: 08 Feb 2008

Postby zukkaweb » 07 Jan 2010

Thanks geektrader,

it really true and it's works well.

Have you got also a simple entry strategy to boost the netprofit or reduce the drawdown?

Regards

User avatar
TomKeough
Posts: 17
Joined: 28 Dec 2009
Has thanked: 1 time
Contact:

Exit Strategy after X-Bars taking in account Profit

Postby TomKeough » 08 Jan 2010

Than you, geektrader. I will try it out.
Regards,
Tom Keough


Return to “User Contributed Studies and Indicator Library”