Trend Trading EA with Automated Loss Recovery

Post your EA's using ALR here
Post Reply
User avatar
Gordon
Trader
Posts: 19
Joined: Wed Feb 22, 2012 7:02 pm

Trend Trading EA with Automated Loss Recovery

Post by Gordon »

SpiderX » Sat Jul 26, 2014 10:39 am wrote:
Gordon » Sat Jul 26, 2014 11:34 pm wrote:This thread has been dead for five days. :o
Thanks for the post.
Is this OOTB ?

Working still on the next version. :)

Cheers
This is pretty much OOTB, but it's my non-hedging version with working stealth type stoploss and the settings are optimised for non-hedging.
Dewey McG
Trader
Posts: 435
Joined: Sat Nov 26, 2011 4:20 pm
Location: Tampa FL

Trend Trading EA with Automated Loss Recovery

Post by Dewey McG »

Gordon » Sat Jul 26, 2014 11:34 am wrote:This thread has been dead for five days. :o
Thanks for contributing. I see lots of people have downloaded this EA and the others, but we could use more feedback
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Trend Trading EA with Automated Loss Recovery

Post by SteveHopwood »

Dewey McG » Sat Jul 26, 2014 4:27 pm wrote:
Gordon » Sat Jul 26, 2014 11:34 am wrote:This thread has been dead for five days. :o
Thanks for contributing. I see lots of people have downloaded this EA and the others, but we could use more feedback
There will be a lot of downloads - and even more after the wrup I shall be sending tomorrow night. Feedback will be slow in coming in because: 1) this ea is not a trading tart and so can be loaded on charts for a substantial length of time before even the first trade is triggered; 2) the ALR stuff if needed can take a long time to kick in.

I started a dedicated demo for this on Thursday on the majors plus GJ. No trades so far. They will take time to kick in.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Fibotrend
Trader
Posts: 45
Joined: Wed Jul 09, 2014 8:07 am

Trend Trading EA with Automated Loss Recovery

Post by Fibotrend »

There will be a lot of downloads - and even more after the wrup I shall be sending tomorrow night. Feedback will be slow in coming in because: 1) this ea is not a trading tart and so can be loaded on charts for a substantial length of time before even the first trade is triggered; 2) the ALR stuff if needed can take a long time to kick in.
that's right. Is there any way we may possibly use the current EAs in real time on different TF. I am happy to trade EURUSD on 5M live and post results, that would speed up testing in real market conditions.

Cheers
User avatar
Gordon
Trader
Posts: 19
Joined: Wed Feb 22, 2012 7:02 pm

Trend Trading EA with Automated Loss Recovery

Post by Gordon »

Spiderman,
I added a few small things to my version which you may consider useful. While experimenting with different ideas and watching the backtest, one test had an unusual condition where I believe it was having the open order closed by the trailing stop and on the same bar it just happen to close below the fast MA to signal a new short trade. An error occurred where the pending buy order did not get deleted, hence the new sell order did not get a new pending buy order. Anyway, when I added a condition to count the pending orders before opening a new signal order, it fixed the problem. It may be of no consequence if you do not use trailing stop or breakeven. The other idea to preserve my account (with only 1:50 leverage) is to add a CountOtherSymbols so that I can set it up on many currencies, but have it trade one currency at a time.

void LookForTrading()
{
double entryPrice;
SignalBuy=false;
SignalSell=false;
RefreshRates();

if(CountOpenTrades(Symbol())>=1)
return;

if(CountPendingTrades(Symbol())>=1)
return;

if(CountOtherSymbols(Symbol())>=1)
return;

RefreshRates(); :lol:
You do not have the required permissions to view the files attached to this post.
User avatar
SpiderX
Trader
Posts: 554
Joined: Thu Aug 22, 2013 4:50 pm

Trend Trading EA with Automated Loss Recovery

Post by SpiderX »

Hi Gordon,

Thanks!
Will look into it.

Cheers
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8
User avatar
Gordon
Trader
Posts: 19
Joined: Wed Feb 22, 2012 7:02 pm

Trend Trading EA with Automated Loss Recovery

Post by Gordon »

Spiderman,

I'm still working on taming this EA on the more volatile GBPUSD. I could not find any profitable settings with my previous version. The problem seemed to be the closing of the trade prematurely with little or no profit due to the fast-MA-cross. So, I added a switch to disable this as an option and also added minimum profit pips if the switch is enabled. I cranked up the ALR_DollarPerPiPLot = 500 to get lower lot sizes and more reasonable drawdown.
You do not have the required permissions to view the files attached to this post.
blazecrown
Trader
Posts: 31
Joined: Thu Jul 31, 2014 10:20 am

Trend Trading EA with Automated Loss Recovery

Post by blazecrown »

hi SpiderX,

first off, i'd like to thank you and Dewey, for starting off this project, kotsh, (both your ALR calculators are great), madpipa, wealthmaster and the rest for sharing this EA to us... you're doing a great work here... i'd like to see how i can help by giving feedback from a user standpoint... i'm so happy to have found this forum and discovered that you guys are working real hard on this ALR EA...

anyways, i've been toying with all your EAs... obviously wealthmaster's and madpipa's are very straight forward to use... your EA however is quite challenging to use as i don''t understand all the parameter inputs you're requiring in your EA (i'm not sure if it's just me)... that being said i believe your EA has so much potential... one thing i like about your EA is that it uses an asymmetrical T/P, which means a different T/P for an UP target from a DOWN target... i believe this is an important feature because in a trending market the market has a greater tendency to hit one target than the other... i.e., in an uptrend, the market has a greater tendency to hit an UP target than a DOWN target, and vice versa... i also see a trailing stop feature in your EA. Although as of this stage i don't know how to fully take advantage of it... i believe it is practically useful when you are in profit zone...

however, in my opinion, what makes your EA complicated to use is because it's trying to do many things which takes away its simplicity... i just happen to believe that the simpler you make it appear to a user, the better (not that it's not complicated by itself)... as Steve Jobs would say, it's genius when you make complicated things simple...

these said, may i suggest the following:

1. may i request if you can have an additional option to make the UP Target, DOWN Target, Entry Price and Hedge Price be inputted as their actual prices and just let the program compute for its Recovery Zone and T/Ps in pips... this is particularly important as this is a convenient way of inputting into the program the key target levels, either they are breakout points, support or resistance levels...

2. may i request if you can have a way of turning off the entry signals as many of us have different ways, with the myriad of indicators available, in entering the market... (i'm just not sure if you already have this on/off feature in your EA... i understand the indicators were placed there to make this EA trade on its own almost fully automatic...)

3. i'm not sure what Risk_percent means... but i''d like to suggest if you can make an option that the $ Risk can be inputted in USD value and not just as a percentage of your balance or equity...

4. if it's not too much, the pip value of the currency pair be integrated within the program without the user inputting its value...

i hope these suggestions won't be too much of a bother to you... we're all looking forward to see this EA come out beautiful... thanks SpiderX...
Last edited by blazecrown on Sun Aug 03, 2014 11:34 pm, edited 5 times in total.
User avatar
SpiderX
Trader
Posts: 554
Joined: Thu Aug 22, 2013 4:50 pm

Trend Trading EA with Automated Loss Recovery

Post by SpiderX »

Hi

Thanks for the feedback.
Can't get much coding done over the weekend as i am freezing my butt in Melbourne.
Will look to improvements one i get back.

Cheers
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8
User avatar
SpiderX
Trader
Posts: 554
Joined: Thu Aug 22, 2013 4:50 pm

Trend Trading EA with Automated Loss Recovery

Post by SpiderX »

Hi all,

Sorry for the lateness in the next version, have been tied up in other work.
renexxxx was kind enough to share his conception of ALR, whereby, he takes the loss in the initial trade and set up the next trade in opposing direction to cover the loss of the initial trade.
After running through the math on this concept with Dewey, we found that this concept resulted in much less risk than the original ALR and lot sizes are smaller.
Since only 1 trade is open at a time, obviously this results in a smaller strain on the account margin compared to the original ALR.
The reason for smaller lot sizes :
For original ALR, the loss of the initial trade (assuming only 1 recovery trade open) is ALR_Zone_Pips + ALR_TargetPips.
In ALR2.0, the loss of the original trade is simply ALR_Zone_Pips.
Since we do not need to cover up the loss of ALR_TargetPips, the lot size is much smaller and manageable.
The other advantage is that the ALRTargetPips to ALRZonePips ratio can be shrunk to a smaller value , i.e ALR_TargetPips:100, ALR_ZonePips:50, and the lot size growth will still be more manageable than the original ALR.
The advantage of this would be less ALR_Turns required.
Thanks again to renexxxx for sharing this.

v2.00
-Major rework of ALR concept
-Initial trade is closed and loss is taken, while the next order in the opposing direction is opened.
-Basically, the next order in the opposing direction is taken to cover the losses of the previous trades
This results in smaller positions and smaller losses for same number of turns.
ALR Variables:

Code: Select all

extern bool   useAutomatedLossRecovery = true;
extern double ALR_ZonePips             = 50;
extern double ALR_TargetPips_SameDir   = 150;
extern double ALR_TargetPips_OppDir    = 150;
extern double ALR_ProfitPips           = 10.0;
extern double ALR_CommissionPips        = 1.0;
extern int    ALR_MaxTrades            = 10;    
extern double ALR_MaxLots              = 5.0;
ALR_ProfitPips is the number of addition pips in profit to add to each trade cycle.
ALR_CommissionPips is the number of pips your broker charges as commission which has to be taken to consideration with each trade that is closed.
ALR_MaxLots limits the maximum lots possible in the ALR progression and it supercedes ALR_MaxTrades.
If ALR_MaxLots is exceeded, then ALR_MaxTrades will automatically be toned down.

Cheers
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8
Post Reply

Return to “Automated Loss Recovery”