Automatic Loss Recovery System (ALR) - read this first

Post your EA's using ALR here
Post Reply
Lagrange
Trader
Posts: 35
Joined: Fri Aug 01, 2014 1:21 pm

Automatic Loss Recovery System (ALR) - read this first

Post by Lagrange »

Yes please I sure want to take it to the next level!
I am totally not interested in trading EA's,I trade manual, but this ALR EA can be useful to manage trades.
About the pip/lotsize issue;

http://www.mql5.com/en/charts/2196963/e ... tments-inc

This was my entry on EURNZD last week.Entry was late for some pips to the downside but I wanted to test this EA. Because the EA took 0.05 lots instead of 0.04 I could get out fast.
The red line was calculated by the ALR EA, very far, but I closed at the high manually for almost breakeven because it was just before NFP...see how they pushed up before news, haha.

ps initial entry was 0.03 lot


best Lagrange
blazecrown
Trader
Posts: 31
Joined: Thu Jul 31, 2014 10:20 am

Automatic Loss Recovery System (ALR) - read this first

Post by blazecrown »

Hi folks,

i noticed from the original formulas:

H(n) = {[(sum_of_P(n-1)+A)(z+h) +0.1*C]/[s+h]} - sum_of_H(n-1)
P(n) = {[(sum_of_H(n)(z+h+s) +0.1*C]/[p+s]} - [sum_of_P(n-1) + A]

the above formulas are in the assumption that pip value is $10/pip.

shouldn't it be that the factor 0.1*C should be C/V instead, wherein V is an input parameter of the currency pair's pip value?

i think this should take care of the correct T/P zone relative to Target Profit in $. what do you think fellas?
TheInsider
Trader
Posts: 20
Joined: Wed Aug 06, 2014 10:14 pm

Automatic Loss Recovery System (ALR) - read this first

Post by TheInsider »

Hi!

My first post here. I hope that I can contribute. I'm both a trader and a programmer.

FYI, I have this EA (original ALR), so I can run and publish tests here. First, this is how the external settings look like...

Image

Everything default except 'ProfitInDollar' which by default is 0.

Since this EA only manages one initially open trade, running backtests with it will ONLY open one random position and then manage its trades.

I have noticed that the lot size increases if the setting 'ProfitInDollars' is higher.

The backtests that I share here are based on DukasCopy TickData with Real spread, no spread markup and $10 per lot deducted in Commission (well aware that this is much more than what most brokers charges).

When running backtests for ALR in most cases it opens 1 position which then is also closed in profit, so no additional positions are opened. I had to try to find a date where it triggers additional hedged positions. I started with 2014.01.01 and ended up with 2014.01.05.

I changed 'MaximumOrders' to 20 to make sure that this settings does not restrict the trading (as with the default value of 15 it did open 15 positions, when in fact it opened 17 positions). Then run 3 tests, with the 'ProfitinDollars set to 0, 10 and 500.

Attached is a zip-file with the 3 tests.

https://www.sendspace.com/file/1c9qre
Last edited by TheInsider on Thu Aug 07, 2014 8:48 pm, edited 1 time in total.
kotsh
Trader
Posts: 31
Joined: Mon Sep 02, 2013 1:58 pm

Automatic Loss Recovery System (ALR) - read this first

Post by kotsh »

Hi Insider,

thanks for sharing the info about the original ALR.

A few question though:

- what happens when ALR trades are triggered and then the terminal is reset or connection is lost ?

- Can you change the ALR zone size once ALR has kicked in to avoid getting chopped in a ranging market?
TheInsider
Trader
Posts: 20
Joined: Wed Aug 06, 2014 10:14 pm

Automatic Loss Recovery System (ALR) - read this first

Post by TheInsider »

I haven't tested this yet, but will, and then let you all know how it behaves. Stay tuned!

On a 100K demo account. I just opened a EURUSD Buy position of 1.00 lot, added ALR and set the ticket number for that order. It then instantly opened a sell stop order and modified the open order with a SL and TP. I then wanted to restart the Empty4 to see what happened, so I clicked on the X in the upper right corner of the Empty4. A window pops up saying that there's an existing ALR pending order, and it's asking if that pending order should be deleted or not. I clicked on No and the Empty4 closed. I then restarted it and can confirm that the pending order is there.

Opened another chart and opened a Sell order for 1 lot, and added ALR and set it to the ticket number for that order.

If I change the ALRZoneSize setting while it's running it instantly modifies the pending stop orders. But it does not change anything in the first opened market order.

Both the Buy and the Sell order was closed with $150 in profit, a total of $300 in net profit. Pending hedged orders was deleted. Then ALR stopped automatically and was also automatically removed from the chart!

I will make more tests to see how it behaves.

I will edit this post and add more info.
Last edited by TheInsider on Fri Aug 08, 2014 5:24 pm, edited 1 time in total.
Dewey McG
Trader
Posts: 435
Joined: Sat Nov 26, 2011 4:20 pm
Location: Tampa FL

Automatic Loss Recovery System (ALR) - read this first

Post by Dewey McG »

blazecrown » Tue Aug 05, 2014 5:06 am wrote:Hi folks,

i noticed from the original formulas:

H(n) = {[(sum_of_P(n-1)+A)(z+h) +0.1*C]/[s+h]} - sum_of_H(n-1)
P(n) = {[(sum_of_H(n)(z+h+s) +0.1*C]/[p+s]} - [sum_of_P(n-1) + A]

the above formulas are in the assumption that pip value is $10/pip.

shouldn't it be that the factor 0.1*C should be C/V instead, wherein V is an input parameter of the currency pair's pip value?

i think this should take care of the correct T/P zone relative to Target Profit in $. what do you think fellas?
Will have a look this weekend when I have some time. My schedule has been swamped the last few days
TheInsider
Trader
Posts: 20
Joined: Wed Aug 06, 2014 10:14 pm

Automatic Loss Recovery System (ALR) - read this first

Post by TheInsider »

Hi again!

Here is a slightly modified version of 'Wealthmasters' "ALR_with_spread". Thius is what I've done...

- Cleaned code to make it more readable and easier to modify. Tab = 3, block { } in same column, added spaces.
- Added external 'FirstOrderDirection' in order to make comparable test with original ALR, and adjusted first OrderSend accordingly.
- Moved 'TradeComment' to external in case someone want to test it on live demo or real accounts.
- Overruled rounding as comparable tests shows that the increased lot size does not have any positive effect on the outcome.

I also renamed XYZ to 'Profit', since in the original ALR there's a setting to add profit.

Attached are some tests made with the original ALR and profit set to 50.

And attached is a zip with similar tests made the same dates using this modded version of 'Wealthmasters' ALR with Spread.

All tests are based on DukasCopy TickData with Real Spread, no spread markup added but $10 per lot as Commission deducted from each closed position.

Note: There's one missing comparable test - for ALR_with_Spread on 2014.01.05 due to an error 130 ( SL/TP ) once it reached order 16. I have to look into this...
2014.08.10 20:52:29.557 2014.02.13 09:22 ALR_with Spread_v8.5-mod EURUSD,M15: OrderSend error 130
2014.08.10 20:52:26.540 2014.02.12 11:38 ALR_with Spread_v8.5-mod EURUSD,M15: modify #16 buy stop 6.79 EURUSD at 1.36435 sl: 0.00000 tp: 1.37935 ok
2014.08.10 20:52:26.540 2014.02.12 11:38 ALR_with Spread_v8.5-mod EURUSD,M15: open #16 buy stop 6.79 EURUSD at 1.36435 ok
You do not have the required permissions to view the files attached to this post.
Last edited by TheInsider on Mon Aug 11, 2014 12:08 pm, edited 2 times in total.
Dewey McG
Trader
Posts: 435
Joined: Sat Nov 26, 2011 4:20 pm
Location: Tampa FL

Automatic Loss Recovery System (ALR) - read this first

Post by Dewey McG »

Fantastic job and thanks so much for your contribution.


I will have to test yours to see if it has the same issue, but I did have an issue with the prior one: I use FinFX ECN Pro which has a minimum size of .1 for a trade. Because of that ALL the trades were rounded up: .1, .2 (instead of .14 etc.) Will this one work correctly with ECN brokers?
Dewey McG
Trader
Posts: 435
Joined: Sat Nov 26, 2011 4:20 pm
Location: Tampa FL

Automatic Loss Recovery System (ALR) - read this first

Post by Dewey McG »

Here is what I mean. I put this new one on FinFX's ECN Pro Demo. The progression of trades goes from .1 to .2 and on up but always rounds up. The correct 2nd trade for instance would be .14, not .2 See PICs of EA on chart and the spreadsheet
You do not have the required permissions to view the files attached to this post.
Lagrange
Trader
Posts: 35
Joined: Fri Aug 01, 2014 1:21 pm

Automatic Loss Recovery System (ALR) - read this first

Post by Lagrange »

Dewey McG » Mon Aug 11, 2014 3:01 am wrote:Here is what I mean. I put this new one on FinFX's ECN Pro Demo. The progression of trades goes from .1 to .2 and on up but always rounds up. The correct 2nd trade for instance would be .14, not .2 See PICs of EA on chart and the spreadsheet
Here a snapshot, the settings/lotsize seems to be right:

http://www.mql5.com/en/charts/2225781/e ... x-group-of

cheers L
Post Reply

Return to “Automated Loss Recovery”