Algorithmic ''centrifuge'' - page 6

 

Found an error in my concept. Optimisation will not help to select indicators and their values for the strategy.

Reason: There is no entry point.

Explanation: Testing and optimising a normal strategy is tied to entry points. Without them the orders will not be opened and there will be no optimisation. Entry points are defined by signals and signals are defined by entry conditions. Entry conditions are based on indicators and constants. Entry points are predefined by the TS logic, and optimization helps to select the values of secondary parameters - stops, lots, etc.

OPTIMIZATION DOES NOT HELP TO IMPROVE ENTRY POINTS! It relies on the determined by the TS entry points and improves the values of secondary parameters.

Therefore:

We cannot go through the parameters defining the entry points within the Optimisation process!


THE ENTRY POINTS MUST BE PREDEFINED BY THE LOGIC OF THE PROGRAM IN ORDER FOR OPTIMIZATION TO WORK.


However, there is a simple solution...

 

Solution:

You need to calculate all entry points in advance. To do this:

  1. Cycle back through history and determine the best areas for trades.
  2. Write the entry and exit points of the trades in an array.
  3. For each entry/exit point calculate and record the values of all indicators from the common base.
  4. Analyze the frequency of approximate repetition of indicator values at the entry points. The closer the indicator values are repeated - the more correctly it picks up the pattern.
  5. At the end of the analysis we will get several indicators that are closest to all entry points. They and their values will become our conditions for entry and exit from the market- that is - we will get our Strategy.
The question is whether it can be tied to the optimization and implemented in the tester.
 
Реter Konow:

Solution:

You need to calculate all entry points in advance. To do this:

  1. Cycle back through history and identify the best areas for trades.
  2. Write the entry and exit points of the trades in an array.
  3. For each entry/exit point calculate and record the values of all indicators from the common base.
  4. Analyze the frequency of approximate repetition of indicator values at the entry points. The closer the indicator values are repeated - the more correctly it picks up the pattern.
  5. At the end of the analysis we will get several indicators that are closest to all entry points. They and their values will become our conditions for entry and exit from the market- that is - we will get the Strategy.
The question is whether it can be tied to the optimization and implemented in the tester.

The only thing left is to solve it with a series of linear equations

 
Реter Konow:

Solution:

You need to calculate all entry points in advance. To do this:

  1. Cycle back through history and identify the best areas for trades.
  2. Write the entry and exit points of the trades in an array.
  3. For each entry/exit point calculate and record the values of all indicators from the common base.
  4. Analyze the frequency of approximate repetition of indicator values at the entry points. The closer the indicator values are repeated - the more correctly it picks up the pattern.
  5. At the end of the analysis we will get several indicators that are closest to all entry points. They and their values will become our conditions for entry and exit the market- that is - we will get the Strategy.
The question is whether it can be tied to optimization and implemented in the tester.

The idea is this:

to make a trend model, run the script through history, so that it saves all of the ideal entry and exit points for trends.

Then, all entry/exit dates should be saved in the Expert Advisor and the calculation of how close they are to the ideal ones should be done in OnTester using some scheme.

 
Aleksey Mavrin:

The idea is this:

Make a trend model, run the script through the history so that it saves all the ideal entry and exit points of the trends.

Then in the Expert Advisor save all entry/exit dates and use OnTester to calculate how close they are to the ideal ones, according to some scheme.

Approximately.

  1. We need to find the ideal entry points on history. We can try to apply optimization to such a search.
  2. Having the ideal entry/exit points, we can easily search for the appropriate indicators and their values. To do this you should save their values at the entry points and then analyze them, selecting the best by proximity of repetitions of their values at the entry points (you can try to automate it).
  3. It is possible to look for the entry points during the history run in the tester "looking back" and evaluating passed segments. In this case, you can do everything in one process - search for entry points and collection of indicator values.
  4. The final determination of appropriate indicators to develop the strategy should be automated by a special statistical mechanism. Maybe in this case we can apply optimization and GA as well. I do not know yet.
 

Hello Peter!

I think you can run the script through the history extremums and collect the statistics of the values the indicator took at that moment. Most likely we will get such a dinosaur:


There are two questions:

- how do we get extrema in the "peeked" history?

- What indicator should be used? After all, a simple, price-derived indicator will sometimes be resold and repurchased for a long time.


A mixture of several indicators or time-varying parameters of one indicator will surely provide a fit for the history. As people have already written here. The input parameters should not be enough to try to reveal the general patterns instead of memorizing all particularities. You know it yourself :)

In general, the question is about an indicator that does not just go up and down after the price, but looks at the trend, knows the current location, senses levels, uses statistics and stuff like that.

 
Реter Konow:

Nikolai, the tester is all we have. ))

So why can't an ordinary computer do the job? The same search for values for the parameters included in the signal.

Yes, even so, but it doesn't matter.

You don't need a tester.

The maximum number of indicators in an effective Expert Advisor is one, but zero is better. You will realize this when you have played with the optimization. The sooner it happens, the better for you, but apparently, you have to go through with it.
It's great, that the field of your interests has moved to the sphere, for whichmqlis intended . Congratulations!

 
Реter Konow:

It goes something like this.

  1. You need to find the ideal entry points on history. You can try to apply optimization to such a search.
  2. Having the ideal entry/exit points, you can easily implement the search for suitable indicators and their values. To do this you should save their values at the entry points and then analyze them, selecting the best by proximity of repetitions of their values at the entry points (you can try to automate it).
  3. It is possible to look for the entry points during the history run in the tester "looking back" and evaluating passed segments. In this case we can do everything in one process - search for entry points and collection of indicator values.
  4. The final determination of appropriate indicators for a strategy should be automated by a special statistical mechanism. Maybe in this case we should use optimization and GA as well. I do not know yet.

I believe it will come to the point, when indicators (any indicators at all) show values in the ideal entry point, like they do in many flat points at false start of trends.

And the task will be reduced to determining whether the market is trending or flat.

By the way, this method may be useful to determine whether this market (on history) was even possible to make a profit with a trend strategy,or only monkeys will survive.

 

As a reminder, the topic under consideration in the thread:

Automating the search for a trading strategy


Within this thread, I am looking for solutions to automate the search and build of a trading strategy. This is a single objective.

The main talking points to help make sense of the problem:

//--------------------------------------------------------------------------------------------------------

A) A trading system consists of a mass of parameters, among which the fundamental ones are:

  • Parameters of the trading signal to enter (open a position)
  • Parameters of exit trading signals (position closing)
  • The position direction (Buy or Sell)
  • The lot, stop and take.

Signals are assemblies of parameters that determine position opening/closing. They are a key element of trading conditions.

Each Signal is based on indicators or formulas to calculate important indicators (there is almost no difference). 4.

4) Each Signal is represented by one or several Parameters (approximately three).

5 Each Parameter from the Signal assembly represents an Indicator or Formula.

Each Indicator or Formula can be represented by ONE Parameter. Several such Parameters constitute a Trading Signal.


7. A TRADING SYSTEM IS A SIGNAL PARAMETERS FOR ENTRY, EXIT, LOT AND STOPS. You may change the strategy by choosing these parameters within the Trading Conditions on the fly. 8.

8. you can automate the search and selection of parameters of the Signal for entry and exit, using the Tester and mechanism Optimization. As a result - to get theeffective in the tester Trading System.

//--------------------------------------------------------------------------------------------------------

B) Optimization is a selection of the best values for the parameters.

1. OPTIMIZATION DOES NOT SELECT PARAMETERS. (To search for the Trading Signal parameters in the Strategy Tester, we need to create our own mechanism).

2. the optimization is partial adjustment of the result under any circumstances.

3) Trade Signal parameters (representing indicators or formulas) may be changed within a trade condition, ONLY IF IN/OUT POINTS ARE FITTED OUT in advance.

//----------------------------------------------------------------------------------------------------------

C) To calculate Ideal Entry/Exit Points, you can apply the Optimisation Mechanism. Indicators are not needed for this. You need a special algorithm.

 
Aleksey Mavrin:

I believe that in the end it will come to the fact that indicators (any indicators at all) will show values in the ideal entry point, the same as in many flat points when trends are false.

And the task will be reduced to determining whether the market is trending or flat.

By the way, this method may be useful to determine whether the market (on history) was even possible to make a profit with a trend strategy, or only monkeys will survive.

The bottom line is that only one result is important - to achieve automation of the search and build of an effective Trading System in the tester.
Reason: