Who wants a strategy? Lots and for free) - page 19

 
orlekino >> :

I've rewritten it to my taste and colour; it looks like something like EoM, but the peaks are incomprehensible.

//  Ease of Movement

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int PeriodMA = 13;
extern int VolDivisor = 10000;
double EoMBuffer[];
double TempBuffer[];

int init()
{
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, EoMBuffer);
   SetIndexBuffer(1, TempBuffer);
   IndicatorShortName("EoM("+ PeriodMA+")");
   SetIndexLabel(0,"EoM("+ PeriodMA+")");
   SetIndexDrawBegin(0, PeriodMA);

   return(0); 
}

int start()
{
   int counted_bars=IndicatorCounted();
   if( counted_bars>0)
      counted_bars--;
   int limit=Bars- counted_bars;
  
   for(int i=0; i< limit-1; i++)
      TempBuffer[ i]= VolDivisor * (High[ i] - Low[ i]) * ((High[ i] + Low[ i]) / 2.0 - (High[ i + 1] - Low[ i + 1]) / 2.0) / MathMax(Volume[ i], 1);

   for( i=0; i< limit; i++)
      EoMBuffer[ i]=iMAOnArray( TempBuffer,Bars, PeriodMA,0,MODE_SMA, i);

   return(0);
}
 
zelda >> :

Interesting, but according to Arms' original idea the indicator should walk relative to 0 and give signals when zero line and SMA are crossed (which are applied to the indicator, not smoothed immediately).

Is it possible to create such a variant? I myself don't know (yet) enough MQlng, so in my code it draws last tick of indicator as infinitely going up (how to fix it - I don't know), but in general context it suits me.

 
FOREXMASTER >> :

not a bad start, but in this programme I would like to see:

1. The choice of generated strategies, because the machine itself can not choose the most appropriate strategy for each, and I have seen much better strategists than the program at the end of the save

I have a slightly different idea, namely the creation of a repository of strategies. I.e. let the user generate 1 strategy per instrument and timeframe and the computer selects it. In addition, he also downloads 20 strategies from the repository. Then 20 tests are run with all of the downloaded strategies and a list is created with their characteristics. The strategy with the worst result is asked to be deleted from the repository and the one that was just generated is added instead.


Thus, the user is left with a list of 21 strategies, 20 of which have already been tested, from which he/she can select all that he/she likes and create the source codes of EAs in MQL4.


In this way a compromise is achieved:


1. A computer selects a strategy out of those generated and it does it not randomly, but takes into account certain characteristics.

2. The user chooses the strategy from the list, i.e. the user has the right to make a choice, including inadequate, subjective and erroneous one. It is up to the user whether to use a balance just drawn by the tester or a time-tested strategy.


But the most important thing is that thereby the repository will be constantly filtered and stored only those strategies that give the best results. And random adjustments will be flushed out of it through natural selection. That is, there is almost no need for forward testing, because we can simply look through the list and choose the strategy that has lasted the most time in the repository.


Plus, in this way, the results will be obtained using distributed computing. In other words, each computer will spend only about 1 / 21 part of its time generating strategies and a much smaller proportion of time testing the strategies.


Unfortunately there is no repository possibility on my previous site, because Ucoz CMS does not allow to manage databases and execute PHP scripts. Therefore, we have to take a separate hosting for the Stock Strategy Builder website, on the basis of which the repository will operate.


I have already completed the major part of the repository and the new version of the program. There are some details, especially concerning the quality of quotes, on which the strategies will be generated and tested. As soon as I work out all these details, I will post the version that supports the repository.

 
Reshetov писал(а) >>

I have a slightly different idea, namely the creation of a strategy repository. ...

... That way, the repository would be constantly filtered and keep only those strategies that produced the best results. And random fits will be flushed out of it through natural selection. So there is practically no need for forward testing ...

... I had to get a separate hosting for the Stock Strategy Builder site, on the basis of which the repository will function.

... I have already made a significant part of the repository and the new version of the software. There are still some details, especially concerning the quality of quotes on which the strategies will be generated and tested. As soon as I work out these details, I will post the version with repository support.

Great idea! Good luck with implementation!

I just do not understand why the forward testing will not be needed.

 
voltair >> :

Great idea! Good luck with the implementation!

Only I'm a bit confused as to why the forward tests won't be required.

Because only time-tested strategies will remain in the repository, and the rest will be gradually removed.


It is clear, that if we downloaded a strategy, which was there for example, half a year, and which shows profit according to the tests, then it will be more trustworthy, than the just generated one.


Although, of course, one may run additional tests by oneself, just in case.

 
Reshetov писал(а) >>

... If you have downloaded a strategy from the repository, which has been there for half a year, and even today it shows a profit in tests, then it is more trustworthy than a newly generated strategy.

I understand - strategies are not just lying there, they are constantly tested and remain in the repository only if they are profitable.

But it may happen that "today" (in the current market) "this" strategy is in deficit and tomorrow it will win back everything with a significant profit.

What market segment will be used to test the strategies?

 
voltair >> :

I understand that strategies are not just stored there, but are constantly tested and remain in the repository only if they are profitable.

However, it happens that "today" (in the current market) "this" strategy is in deficit, and tomorrow it will win back everything with a significant profit.

At which market segment will the strategy be tested?

For this reason, I assume that the history section should be at least 8000 bars. I.e. the program should reject quotes with less than 8000 bars. Also it should reject the obsolete quotes, for example, if the hst file has not been refreshed during last day.


Thus, the historical data must be sufficiently long, long-term and as recent as possible. Therefore, the strategy is no longer a "one-day" strategy at this point in history, as the end result will be the overall total for the entire period, rather than the individual chunks.

 
Reshetov писал(а) >>

...I assume the history section should be at least 8000 bars. ...

Probably for large timeframes this is ok. But probably it is not enough for minute or M5. Although, the question is, what timeframes will the strategies be kept for? Are there any tried and tested methods (or experience) to select the number of bars for testing? I usually do not look for less than 20000 bars. But may be it is wrong...

 
voltair >> :

It's probably OK for large timeframes. But probably not enough for minutes or M5. But my question is, what timeframes will the strategies be kept for? Are there any tried and tested methods (or experience) to select the number of bars for testing? I usually do not look for less than 20000 bars. But maybe it's wrong.

So far I've settled on the golden mean, i.e. at least 8000 bars in historical data. More is possible, less is not.

 

If we allow removing strategies from the repository based on negative test results, it is not quite correct. Because there may be cases when someone uploads broken and leaky quotes and after running tests by them, deletes all profitable strategies.


It is better to give each strategy a rating, e.g. -100 to +100. On the initial placement of a strategy in the repository it will be given a zero rating.


All strategies will be sorted by rating in descending order, i.e. from maximum to minimum. The software will load the top 20 strategies with maximum rating and run tests on them. If the result of the test is positive and the strategy's rating is less than 100, then it is increased by 1. If the result is negative, then it is decreased by 1. If the rating is below -100, the strategy is removed from the repository.


1. Older strategies that have been tested and proven over time will have the highest rating, so they will appear higher in the TOP-20.

2. One day old strategies will gradually go down in the ratings and upon reaching the -100 level they will be deleted.

3. In case the program works with broken quotes, it will only be able to change the rating by 1, i.e. it will not globally affect the repository ranking results, but only adjust them slightly.