Competition. I will write an expert for free. - page 4

 

Wow, it's similar. It's a whole trading system. It's the first time I've seen an indicator with a detailed description, a bit rambling though, but still, kudos.

 
SK. писал (а) >>

The question is: What is the best way to program - to simply open market or to hold pending stop orders at internal levels?

If we open the market ones, then the related question is how to identify the breakthrough - by a simple touch or with a tolerance?

If the system does not "wait" for some situation to occur, but "knows" about it in advance, then placing pending orders is justified. But you need to look at it from the point of view of implementing the function in AG4. After all, the goal, as I understand it, is not to create a system, but to show the possibilities of AG4.

As far as I studied the indicator operation, it identifies the breakout by closing of a candle where the breakout occurred (see comments), i.e. the candle closed below the level set. I suggest to keep this variant. And it will be easier to test.

 
Xadviser писал (а) >>

Logically, if the system does not "wait" for some situation to happen, but "knows" about it in advance, then setting pending orders is justified. But you need to look at it from the point of view of implementing the function in AG4. After all, the goal, as I understand it, is not to create a system, but to show the possibilities of AG4.

As far as I have studied the work of the indicator, it identifies the breakout by closing of a candle at which the breakout occurred (see comments), i.e., the candle closed below the level set. I suggest to keep this variant. And it will be easier to test.

OKAY.

I suggest to stop at this variant:

1. In an "empty" period, two pending orders are set - BuyStop and SellStop.

2. When one of the orders triggers, the other one is automatically deleted.

3. The TP is established on a level of the far target. 4.

4. SL is positioned at the opposite level of opening.

5. SL and TP are modified following the levels.

6. When the market price reaches the near target:

6.1 The order is closed at 45% of the original value.

6.2 SL shall be moved to Breakeven, say by 2 pips (2 pips up from the open order price).

6.3. starting from the nearest target, SL is trailing the market price at a distance equal to the current price difference between the open and nearest target price.

7. When the market price reaches the middle target, the order is closed at 30% of the initial price of the order.

8. When the market price reaches the far target, the order is closed at 25% of the initial order value (final).

9. When closing at TP, the strategy works in line with point 1.

10. If SL has not yet been set to Breakeven, at SL close the order is "reversed" to the opposite market price and the same from point 3 onwards.

 

There are also some little things to consider.

For example, if the indicator starts "not thinking straight", just close everything as it is.

This situation seems to me to be an oversight (upper targets below the opening level):

 
SK. писал (а) >>

There are also some little things to consider.

For example, if the indicator starts "not thinking straight", just close everything as it is.

This situation seems to me to be an oversight (upper targets below the opening level):

Yep.... I understand that the price value went out of the triangle that forms the levels and the indicator started to get weird.

If you look at the dynamics, until that moment there was a picture with upside targets that were reached (see fig.)

I don't want to complicate things, but it looks like we need to check the position of levels - upper above price, lower below price.

If an open order has already been set, then the sequence of actions listed above (1-10) will provide support for the order.


 

I deal with my own codes quickly and easily. With someone else's, uncommented, and even specific in execution, it's a hassle. How do I... decide...

Pending orders are placed, one of them has transformed into a market one, another pending order is deleted. We set a stop on one of the targets and put a profit on the opposite opening level.

We stop.

The levels begin to shift - now up, now down. What we should do in this case with stop orders?

Options:

- drag them behind levels (in reality this is incorrect because not only targets but also open levels also dance, and often "flip")

- you can leave them immovable, whatever happens (also somewhat unnatural, levels go astray).

--

I want to give up partial closure. Not because AG is not able to do it, but because levels shift. It requires thorough analysis, but this analysis and code would contain more logic than AG code itself. It would only confuse the user. However, it is possible to set a partial closing, for example, at half-way to profit (again, if it stands immovable).

If we do nothing else, we will get a demonstration of order line dragging behind the graphical object. That's not enough.

I'd like to do something else. For example, we need conditions of Breakeven. If there are no certain suggestions, we can set as a conditional value, for example, 10 points of profit. And something else. For example, trading reversal (i.e. at closing on profit) with a close target.

--

Who has the enthusiasm to look at AutoGraf 4's list of tools http://autograf.dp.ua/Pages/2/24/2400.htm and suggest something more or less sensible. As for the profitability of the strategy, this is not considered at all. You just need to make formal rules. At least somewhat meaningful ones.

 
SK. писал (а) >>

I deal with my own codes quickly and easily.

With someone else's, uncommented, and even specific in execution - one nerve-racking.

I realise it's primitive, but for students the 2 simple examples below might be illustrative. If it doesn't fit in the morning I'll delete it.

A trend consists of the following Formations (Each complete bar is considered together with the previous one and a Formation is determined. CoordinatesClose and Open do not matter):

- Movement Formation:

High[i+1]>High[i+2]&&Low[i+1]>Low[i+2] - Bull Formation, and High[i+1]<High[i+2]&&Low[i+1]<Low[i+2] - Bear Formation,

- then Formation Pauses:

High[i+1]<High[i+2]&&Low[i+1]>Low[i+2] - Compression Formation , and High[i+1]>High[i+2]&&Low[i+1]<Low[i+2] - Extension Formation ,

- then Formations Extremes:

High[i+1]<High[i+2]&&High[i+2]>High[i+3] - Bearish Extremum orLow[i+1]>Low[i+2]&&Low[i+2]<Low[i+3] - Bull Extremum.

Next Analysis:

To enter a position you need to open it in the direction of the Movement Formation.

To suspend or close the position, the bars of the Expansion Formation must move out of the direction of the previous Formation.

Low[i+2]<Low[i+3] for a Bullish Formation or

High[i+2]>High[i+3] for a Bearish Formation or

reversed Formation through Extremus Formation to:

High[i+1]<High[i+2]&&High[i+2]<High[i+3]&&High[i+3]>High[i+4] - Bearish turn orLow[i+1]>Low[i+2]&&Low[i+2]>Low[i+3]&&Low[i+3]<Low[i+4] - Bull turn.

Thus, using the simplest visual analysis you can stay in the trend for a long time without using any indicators.

Let's read the definition (taking into account that the candle count is reversed and we'll start with the 3rd candle, we can do it with the 5th ... 10th ...):

If the Hi of the 2nd candle is higher than the Hi of the 3rd one, and simultaneously the low of the 2nd candle is higher than the low of the 3rd one, we have a moving formation (a trend of 2 candles) which vector is directed upwards.

If the Hi of the 1st candle is higher than the Hi of the 2nd candle and simultaneously the Lo of the 1st candle is higher than the Lo of the 2nd candle, we have a Movement Formation (trend of 3 candles), the vector of which keeps going upwards.

If we entered into a position on the 2nd candle and the close of the 1st is higher than the close of the 2nd, we can close the position in profit.

If we wait for the developments, and the ratios will continue to be met, we will earn more.

If the BF of the 1st candle goes down below the BF of the 2nd candle, we may close the position with a loss or we may wait for the situation to develop. Here we need to connect additional filters. Timing, levels, events, .....

Usually when there is divergence beyond oscillator levels it is better to keep the position minimal. Then we close extra lots when the Lo of a candle crosses half of the range of the previous formation.

I am adding on request of my colleagues:

- the size of candlesticks does not matter

- colour i.e., the mutual position of opening and closing too - but this is true for candlesticks from D1
- On the frames below this strategy should be equipped with a lot of filters and I don't do it except sometimes for the adrenaline
- we move the stop on the border of the previous formation (remember 3 candles is 2 Formations), all this on D1 and low-volatility pairs
- we look how the candles behave H8 and if there are no sharp reversals in the first 2 hours of a new session, you can take a risk, considering the sufficient condition of the current formation and going beyond the previous high or low, all this assuming that no news of the 1st category of importance is expected - better to follow the news indicator, if you need any will lay out

- The candle from an Expansion Formation which takes out a stop is the first candle of a new Formation, and I usually wait for that Formation to complete.


Also:

Using the daily closing prices of the Dow Jones Industrial Average from January 1900 through March 2001, we find that . With an initial capital of $100, an investor using this strategy (p.831, R. Colby, "Encyclopedia of Technical Indicators", Moscow, "Alpina Business Books", 2004) ..., could earn $10 ` 772 ` 9856.

Trading the Dow Index:

Open a position (buy) at the current daily closing price of the instrument when that closing priceis above yesterday's MA-LW6-Close . Correspondingly close(if previously opened) a sell position.

tOpen a position (sell) at the current daily closing price of an instrument when that closing price is lower than yesterday's MA-LW6-Close.
 

What's that? Just open-close? You can do that, of course. There's no need to remove it.

I have to go away tomorrow for a couple of days and then we'll do that in a day.

You can think about it. Maybe, we can somehow modify orders to this strategy - tighten stops or something else.

 
SK. писал (а) >>

What's that? Just open-close? You can do that, of course. There's no need to remove it.

I have to go away tomorrow for a couple of days and then we'll do that in a day.

You can think about it. Maybe, we can somehow modify orders to this strategy - tighten stops or something else.

Order modifications can be taken from here:

Files:
4erepa_hi_lo.rar  347 kb
 
and an indicator explaining something like this - attaching:
Files:
Reason: