
06-26-2009, 10:32 AM
|
|
Member
|
|
Join Date: Mar 2007
Location: shanghai
Posts: 39
|
|
Quote:
Originally Posted by mladen
Lazy   
Replace that code with this one :
PHP Code:
for(i=0; i<barsPerTimeFrame;i++,k++)
{
current = ExtMapBuffer7[k]-ExtMapBuffer6[k];
prev = ExtMapBuffer7[k+1]-ExtMapBuffer6[k+1];
if (((current<0)&&(prev>0))||(current<0)) up= false;
if (((current>0)&&(prev<0))||(current>0)) up= true;
//
//
//
ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;
ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef;
It is what is called "it has everything, but at wrong place". Only the steps were in a wrong order, nothing else 
Btw: those are, when you are writing the code, hardest to spot. When someone else looks at it, it is likely that he/she will spot it immediately . Once I lost 3-4 days just to find out that I need to invert 2 line position
regards
mladen
|
THANK YOU!
You are great!
|