Problems found during the back testing and can't find the root cause! - page 3

 

Does iHighest() return the bar among period at the left or at the right of 'i'? 

 

 MaxH = High[iHighest(NULL,0,MODE_HIGH,period,i)];

 

Besides, please also refer to my previous post just in front of this post.  

 

Dear JollyDragon,

Happy that you see that the indicator re-calculate.

The fisher code is always the same, it's easy to identify.

the code just re-inject a data, as many indicator does by some mean, ( they store past value ot datas on bar 1 2 3 ),  this indicator don't do that, that why it re-calculate  :

 for(i=limit-1; i>=0; i--)
     {
      MaxH = High[iHighest(NULL,0,MODE_HIGH,Solar_period,i)];
      MinL = Low[iLowest(NULL,0,MODE_LOW,Solar_period,i)];
      price = (High[i]+Low[i])/2;
      Value = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;
      Value=MathMin(MathMax(Value,-0.999),0.999);
      ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
      Value1=Value;
      Fish1=ExtBuffer0[i];
     
      if(ExtBuffer0[i]>0) ExtBuffer1[i]=Solar_limit;
      else ExtBuffer1[i]=-Solar_limit;
     }
 
jollydragon:

Does iHighest() return the bar among period at the left or at the right of 'i'? 

 

To the left
 

 ffoorr, GumRai, thank you.

 

Although the code store the data of bar1, you can see it doesn't re-calculate the bars to the left of bar0.

So I'm still confused what caused the re-drawing as there's no code to re-calculate the bars before bar0. 

for(i=limit-1; i>=0; i--)
     {
      MaxH = High[iHighest(NULL,0,MODE_HIGH,period,i)];
      MinL = Low[iLowest(NULL,0,MODE_LOW,period,i)];
      price = (High[i]+Low[i])/2;
      Value = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;
      Value=MathMin(MathMax(Value,-0.999),0.999);
      ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
      Value1=Value;
      Fish1=ExtBuffer0[i];
      if(ExtBuffer0[i]>0) ExtBuffer1[i]=10;
      else ExtBuffer1[i]=-10;
     }
 

We don't know what value is given to limit.

I strongly suggest that you right click on this indicator and move it to the bin! 

      ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
      Value1=Value;
      Fish1=ExtBuffer0[i];

 Assuming that Fish1 is a global or static variable and the last bar is recalculated

Fish1 is given a value based on Bar[0] data when i==0

Then when the bar[1] is re-calculated, the value for Fish1, created in bar[0] is used to create a value for bar[1] 

I don't know what the indicator is intended to do, but any indicator that uses data pertaining to i bar and then uses that in an earlier bar is a bad indicator.

 
GumRai:

We don't know what value is given to limit.

 

Please refer to post 20 where the whole indicator file was attached. Below was pasted again. 

Attached files: 
   solarjoy.mq4  (6.11 KB)   delete
  
GumRai:

Then when the bar[1] is re-calculated, the value for Fish1, created in bar[0] is used to create a value for bar[1] 

I don't know what the indicator is intended to do, but any indicator that uses data pertaining to i bar and then uses that in an earlier bar is a bad indicator.

 

 You can see 'i' changes from 'limit-1' to '0' that is from left to right for Bars calculation.

So the value of Fish1 calculated in bar[1] is used to create a value for bar[0]. Why do you think about it on the contrary?

Therefore I don't think this indicator is that kind of bad indicator according to my understanding on the code.

Anyway, I finally observed the re-drawing and it approves it's that kind of bad indicator.

However, I need know how to correct the code to prevent re-drawing as self-improving. 

 

for(i=limit-1; i>=0; i--)
     { 
       ...
      }
 

This one fisher do not repaint, it look good, compare with solar_joy, the signal is one bars late, but it is the same indicator.

https://www.forex-tsd.com/metatrader-4/474-fisher-14.html#post214965

Problem is not indicators, they are perfect, it's the market which alway change, it's never the same.

An indicator which give perfect signal in some trend market, will give only false signal in another market.

One's will always have to filter the signals from good oscilator, weither using StopLoss and TakeProfit,

wether using a trend indicator.


I think The fisher indicator do work, it's just one bar late, it recalculate, it do not repaint, this one repaint, put it in an EA in the tester, and you will see :

https://www.forex-tsd.com/ideas-suggestions/25934-bulletproof-11.html#post351354

 
jollydragon:

 

So the value of Fish1 calculated in bar[1] is used to create a value for bar[0]. Why do you think about it on the contrary?

Ok fair enough, but you code that I referred to did not include any calculations for limit and I wasn't going to look back over 3 pages to see if it was included elsewhere.

So this indicator doesn't recalculate for bar[1] on every tick.

 But still

 ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
 Fish1=ExtBuffer0[i];

 will allow different calculations on the first run on closed bars to what it does on the current bar.

What it will do on the first tick of a new bar is 

ExtBuffer0[0]=0.5*MathLog((1+Value)/(1-Value))+0.5*ExtBuffer0[1];

 On subsequent ticks of the same bar it will calculate

ExtBuffer0[0]=0.5*MathLog((1+Value)/(1-Value))+0.5*ExtBuffer0[0];

 Which is a sort of compounding

 

This is tradable, the solar_joy/fischer give a signal one bar earlier, compared to a non recalculated fisher,

Then take the signal on bar 1 and 2, and go and see if the signal is still there on bar 2 and 3.

If the signal has fade away then close the order.

 

  if(Joy2 <= EA_Limit && Joy1 >= EA_Limit)  open_order( OP_BUY); 
 if( (Joy3 <= EA_Limit && Joy2 >= EA_Limit)== false ) close_order( OP_BUY); 
 
ffoorr:

This one fisher do not repaint, it look good, compare with solar_joy, the signal is one bars late, but it is the same indicator.

https://www.forex-tsd.com/metatrader-4/474-fisher-14.html#post214965

I think The fisher indicator do work, it's just one bar late, it recalculate, it do not repaint, this one repaint, put it in an EA in the tester, and you will see : 

https://www.forex-tsd.com/ideas-suggestions/25934-bulletproof-11.html#post351354


 

Dear ffoorr, I can't open the pages and can't access the site, www.forex-tsd.com. Maybe my internet configuration has some problem.

Please let's focus on my code. It's only about 10 lines of codes for the main content. 

However, it's still so difficult for us to find the root cause for re-painting of historical bars. 

Reason: