Hedging Martingale. - page 17

 
transcendreamer:

crazy research....

spread-synthetic with total volume of 0.5 lots

test 2 months, forward 1 month

grid $55

stupid grid doubling

worst case drawdown: 4*1+3*2+2*4+1*8=26 steps * $55 = $1,430

but the margin! 26*27000=702000 rubles!

we need to be softer.

Fuck this martingale, arithmetic progression is safer or at least fibo-progression
 
transcendreamer:

in general, a fractal is almost a 1-2-3 / 2B pattern

I draw lovely fractals with my own indicator portfolio optimizer (in kodobase, see my profile)

OK. I'll have a look.
 
R0MAN:
I see. Is it all in MT?

MT4

I haven't mastered MT5 yet, they say it's not difficult and the language seems to be similar

 
transcendreamer:
I don't need this martingale, arithmetic progression is safer or at least fibo-progression
I have both of them in the averaging option for optimisation. The code is simple, I can send it on MT4 in my personal message.
 
transcendreamer:

MT4

I have not yet mastered MT5, they say it is not difficult and the language seems to be similar

understood.
 
transcendreamer:

How about this?

*almost* immunised from the 2012 synthetic trend

It's beautiful! Will have time to try and use it.
 
edutak: TOR

I will not speak about lots yet, let's try to write TOR for the snipper, just for an example, I think I still have some inspiration to help :)


A short description, so as not to scare the proger the number of requirements :)

There is a TS Sniper, the Expert Advisor opens a position in the channel displayed on the indicator, the signal to sell is crossing of the price at the upper border of the channel, the signal to buy is crossing of the price at the lower border of the channel. Stop-loss for a position to be opened may be fixed, or determined dynamically by the ATR indicator over the last few bars. If the entry is unsuccessful, the position is closed by the stop loss. If the position is profitable and the price has reached the opposite channel boundary, i.e. if the opposite signal is received, the first position remains open, while the second position is opened, directed in the opposite direction, but with a bigger lot. For the second position, the lot and stop-loss are calculated so that if the second position shows a loss, it does not exceed the existing profit of the first, the positions continue to open until one of them will not knock out a stop-loss, after which all positions are closed and the cycle repeats, starting with a new signal from the indicator.


More detailed requirements :

1. we need an advisor on the TS Sniper system

1.1. differently directed orders are used, therefore it is more practical to write it for MT4

1.2. the main objective is to maximize the profit of an open position in which there is already a profit, and to achieve a risk/profit ratio of at least 1 / 3 by adding positions according to the pendulum principle

1.3. the advisor should not depend on the number of digits after the decimal point of the selected symbol price, 4 and 5 digits are determined automatically

1.4. the Expert Advisor settings should contain

- all parameters of the indicators used

- initial lot size

- a fixed minimum size of profit to close a position, if 0, then calculate it adaptively as half of the price range on the ATR indicator

- a fixed stop loss, the default value is 0, if it is 0, then the stop will be adaptive (1) and will be determined by the value of the ATR indicator

1.6. all positions are opened using market orders

1.7. for ease of further improvement of the Expert Advisor and replacing the indicator for another one, be sure to include the definition of buy and sell indicator signals into separate functions


2. the indicator used for drawing of the channel in which the price moves - Bollinger Bands

2.1. a series of positions (market order) is used in the Expert Advisor; they are opened successively, until one of them closes through a stop loss

2.2. if at least one position has been closed by a stop loss, the whole series of positions will be closed

2.3. conditions for opening the first position of a series :

- BUY position is opened if price has crossed the lower limit of the channel

- SELL position is opened if price has crossed the upper border of the channel

2.4. the stop loss for the first position in the series can be set to one of 2 values :

- a fixed value, specified by a user in the indicator settings

- if the fixed value in the settings is 0, then the stop-loss is calculated using the ATR indicator with the period, set by a user in the indicator settings


3. after the opening of the first position in the series the following outcomes are possible :

3.1. if entry is unsuccessful and price goes against the trade direction, the position is closed by a stop-loss and the system accepts a loss

3.2. if entry is successful and the position generates profit, then its stop-loss is moved to Breakeven and we wait for the price to reach the opposite side of the channel, increasing the profit

3.3. if price reverses against the position, wait to close the position at breakeven

3.4. if the price reaches the opposite channel boundary and we get a signal to open a reverse trade, then :

- the first trade remains active

- opposite (opposite) position is opened opposite to the first one (with bigger lot)

- the size of the lot and Stop Loss in the second position has to be chosen so that if the second position is unsuccessful and a stop loss is taken, the loss in it is less than the profit in the first position

- the lot of each successive position in the series has to be bigger than the preceding one.

3.5. if the second position is unsuccessful and is closed by a stop loss, then both positions (the whole series) shall be closed

3.6. if the second position is successful, the stop is moved to the break-even position, if the price reaches the opposite channel boundary, calculation of lots and stops are repeated for the next (third) position

3.7. the cycle repeats until at least one position is closed using a stop loss, if at least one stop is triggered, the whole series of positions is closed


(1) - an example of adaptive stop loss - http://blog-forex.org/izuchaem-adaptivnoe-upravlenie.html


I think that's how it should be, such a ToR should be understandable to a programmer :)

according to such TOR the profit graph in the tester should look like this, but it will be very dependent on the selected currency pair, and that's why it may not be very stable ...

https://c.mql5.com/2/4/Piramiding__2.png

 
artemiusgreat:

About the lots we won't talk about yet, let's just try to write TOR for the snipper, just for an example, I think I still have some inspiration to help :)


A short description, so as not to scare the proger the number of requirements :)

There is a TS Sniper, the Expert Advisor opens a position in the channel displayed on the indicator, the signal to sell is crossing of the price at the upper border of the channel, the signal to buy is crossing of the price at the lower border of the channel. Stop-loss for a position to be opened may be fixed, or determined dynamically by the ATR indicator over the last few bars. If the entry is unsuccessful, the position is closed by the stop loss. If the position is profitable and the price has reached the opposite channel boundary, i.e. if the opposite signal is received, the first position remains open, while the second position is opened, directed in the opposite direction, but with a bigger lot. For the second position, the lot and stop-loss are calculated so that if the second position shows a loss, it does not exceed the existing profit of the first, the positions continue to open until one of them will not knock out a stop-loss, after which all positions are closed and the cycle repeats, starting with a new signal from the indicator.


More detailed requirements :

1. we need an advisor on the TS Sniper system

1.1. Multidirectional orders are used, so it is more practical to write it for MT4

1.2. the main objective is to maximize the profit of an open position in which there is already a profit, and to achieve a risk/profit ratio of at least 1 / 3 by adding positions according to the pendulum principle

1.3. the advisor should not depend on the number of digits after the decimal point of the selected symbol price, 4 and 5 digits are determined automatically

1.4. the Expert Advisor settings should contain

- all parameters of the indicators used

- initial lot size

- a fixed minimum size of profit to close a position, if 0, then calculate it adaptively as half of the price range on the ATR indicator

- a fixed stop loss, the default value is 0, if it is 0, then the stop will be adaptive (1) and will be determined by the value of the ATR indicator

1.6. all positions are opened using market orders

1.7. for ease of further improvement of the Expert Advisor and replacing the indicator for another one, be sure to include the definition of buy and sell indicator signals into separate functions


2. the indicator used for drawing of the channel in which the price moves - Bollinger Bands

2.1. a series of positions (market order) is used in the Expert Advisor; they are opened successively, until one of them closes through a stop loss

2.2. if at least one position has been closed by a stop loss, the whole series of positions will be closed

2.3. conditions for opening the first position of a series :

- BUY position is opened if price has crossed the lower limit of the channel

- SELL position is opened if price has crossed the upper border of the channel

2.4. the stop loss for the first position in the series can be set to one of 2 values :

- a fixed value, specified by a user in the indicator settings

- if the fixed value in the settings is 0, then the stop-loss is calculated using the ATR indicator with the period, set by a user in the indicator settings


3. after the opening of the first position in the series the following outcomes are possible :

3.1. if entry is unsuccessful and price goes against the trade direction, the position is closed by a stop-loss and the system accepts a loss

3.2. if entry is successful and the position generates profit, then its stop-loss is moved to Breakeven and we wait for the price to reach the opposite side of the channel, increasing the profit

3.3. if price reverses against the position, wait to close the position at breakeven

3.4. if the price reaches the opposite channel boundary and we get a signal to open a reverse trade, then :

- the first trade remains active

- opposite (opposite) position is opened opposite to the first one (with bigger lot)

- the size of the lot and Stop Loss in the second position has to be chosen so that if the second position is unsuccessful and a stop loss is taken, the loss in it is less than the profit in the first position

- the lot of each successive position in the series has to be bigger than the preceding one.

3.5. if the second position is unsuccessful and is closed by a stop loss, then both positions (the whole series) shall be closed

3.6. if the second position is successful, the stop is moved to the break-even position, if the price reaches the opposite channel boundary, calculation of lots and stops are repeated for the next (third) position

3.7. the cycle repeats until at least one position is closed using a stop loss, if at least one stop is triggered, the whole series of positions is closed


(1) - an example of adaptive stop loss - http://blog-forex.org/izuchaem-adaptivnoe-upravlenie.html


I think that's how it should be, this TOR should be understandable to a programmer :)

according to such TOR the profit graph in the tester should look like this, but it will be very dependent on the selected currency pair, and that's why it may not be very stable ...

https://c.mql5.com/2/4/Piramiding__2.png

And if an order is closed by a Stop Loss but at Breakeven - is the entire series closed or it is closed only when the order closes at Stop Loss?
 
artemiusgreat:

We will not speak about lots yet, we will just try to write TK for the snipper, purely as an example, it seems we still have the inspiration to help :)


A short description, so as not to scare the proger the number of requirements :)

There is a TS Sniper, the Expert Advisor opens a position in the channel displayed on the indicator, the signal to sell is crossing of the upper border of the channel, the signal to buy is crossing of the price and the lower border of the channel. Stop-loss for a position to be opened may be fixed, or determined dynamically by the ATR indicator over the last few bars. If the entry is unsuccessful, the position is closed by the stop loss. If the position is profitable and the price has reached the opposite channel boundary, i.e. if the opposite signal is received, the first position remains open, while the second position is opened, directed in the opposite direction, but with a bigger lot. For the second position, the lot and stop loss are calculated so that if the second position shows a loss, it does not exceed the existing profit of the first, the positions continue to open until one of them will not knock out a stop loss, after which all positions are closed and the cycle repeats, starting with a new indicator signal.


More detailed requirements :

1. we need an advisor on the TS Sniper system

1.1. differently directed orders are used, therefore it is more practical to write it for MT4

1.2. the main objective is to maximize the profit of an open position in which there is already a profit, and to achieve a risk/profit ratio of at least 1 / 3 by adding positions according to the pendulum principle

1.3. the advisor should not depend on the number of digits after the decimal point of the selected symbol price, 4 and 5 digits are determined automatically

1.4. the Expert Advisor settings should contain

- all parameters of the indicators used

- initial lot size

- a fixed minimum size of profit to close a position, if 0, then calculate it adaptively as half of the price range on the ATR indicator

- a fixed stop loss, the default value is 0, if it is 0, then the stop will be adaptive (1) and will be determined by the value of the ATR indicator

1.6. all positions are opened using market orders

1.7. for ease of further improvement of the Expert Advisor and replacing the indicator for another one, be sure to include the definition of buy and sell indicator signals into separate functions


2. the indicator used for drawing of the channel in which the price moves - Bollinger Bands

2.1. a series of positions (market order) is used in the Expert Advisor; they are opened successively, until one of them closes through a stop loss

2.2. if at least one position has been closed by a stop loss, the whole series of positions will be closed

2.3. conditions for opening the first position of a series :

- BUY position is opened if price has crossed the lower limit of the channel

- SELL position is opened if price has crossed the upper border of the channel

2.4. the stop loss for the first position in the series can be set to one of 2 values :

- a fixed value, specified by a user in the indicator settings

- if the fixed value in the settings is 0, then the stop-loss is calculated using the ATR indicator with the period, set by a user in the indicator settings


3. after the opening of the first position in the series the following outcomes are possible :

3.1. if entry is unsuccessful and price goes against the trade direction, the position is closed by a stop-loss and the system accepts a loss

3.2. if entry is successful and the position generates profit, then its stop-loss is moved to breakeven and we wait for the price to reach the opposite side of the channel, increasing the profit

3.3. if price reverses against the position, wait to close the position at breakeven

3.4. if the price reaches the opposite channel boundary and we get a signal to open a reverse trade, then :

- the first trade remains active

- opposite (opposite) position is opened opposite to the first one (with bigger lot)

- the size of the lot and Stop Loss in the second position must be chosen so that if the second position is unsuccessful and a stop loss is taken, the loss in it is less than the profit in the first position

- the lot of each successive position in the series has to be bigger than the previous one.

3.5. if the second position is unsuccessful and is closed by a stop loss, then both positions (the whole series) shall be closed

3.6. if the second position is successful, the stop is moved to the break-even position, if the price reaches the opposite channel boundary, calculation of lot and stop are repeated for the next (third) position

3.7. the cycle repeats until at least one position is closed using a stop loss, if at least one stop is triggered, the whole series of positions is closed


(1) - an example of adaptive stop loss - http://blog-forex.org/izuchaem-adaptivnoe-upravlenie.html


I think it's something like this, the programmer should be able to understand such TOR :)

according to such TOR the profit graph in the tester should look like this, but it will be very dependent on the selected currency pair, and that's why it may not be very stable ...

https://c.mql5.com/2/4/Piramiding__2.png

I don't understand much about Forex, but even I can see the errors that will prevent the Expert Advisor from being profitable.

1. The entry points in the TS Sniper are set after the false level breakout. That is, most people have blown stops. The use of the standard computer indicator is not reasonable. We will be among them.

2.Stop should be transferred to the B/B only in one case, when the lock of multi-directional orders is not formed before the news release.

3. The first entry is made by two orders, with the same volume. When a profit is accumulated on the orders, one order closes, and the other order is outside the channel, all is risk=0.

4. the second entry point is determined in exactly the same way as the first. after a false breakout level, there is a consolidation, then the price went further, and only at this point does the transaction open (you can not enter the transaction, earlier in time - we will find ourselves in the crowd).

5.Т/P of the first order, is at the level of S/L of the second order. volume and S/L of the second order depend on what profit we have on the first order.

6. The third entry is not necessary, nothing will come out of it. If the robot will accurately identify two entry points and work correctly, the deposit will increase by 40-50% per month, if one entry point, then 20% per month.

For this system, the situation is about 70% of cases. There are others, but they should not be considered.

I suggest to consider only euro/dollar for now.

The main trading is done at M5 and this level is taken into consideration, the price rebound may occur from it or not. (as a rule, it bounces).

The indicator used for constructing the Expert Advisor is good, but I do not know how to detect a false level breakout. I do not understand how to formulate it as a ToR.

I can trade based on indicator levels, but it is a different strategy.


We should not lose our inspiration).
 
What's the point of holding the first position if the opposite one is opened with an increased lot? Manually, it can be explained by the fact that the trader feels more comfortable, but why would an EA do that?


Reason: