[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] heikin ashi problem



PureBytes Links

Trading Reference Links

Try this:

while (n<f){
  if (haOpen[i] <= Max(haOpen[i-n],haClose[i-n]) AND
      haOpen[i] >= Min(haOpen[i-n],haClose[i-n]) AND
      haClose[i] <= Max(haOpen[i-n],haClose[i-n]) AND
      haClose[i] >= Min(haOpen[i-n],haClose[i-n])){
    temp[i] = n;
  }else{
    temp[i] = 0;
  }
}

// Re-read help files regarding use of arrays inside of for, while, do, 
etc. loops.

-- Keith

razepy wrote:

> modified Heikin-Ashi technique
>
> compares current bar open to close range
> with prior bars...if current is within on of the 6
> prior bars then color remains the same
>
> there is a problem with the while loop
> thanks for help
>
>
>
>
> f=7;
>
> HaClose = (O+H+L+C)/4;
>
> HaOpen[ 0 ] = O[ 0 ];
> for( j = 1; j < BarCount; j++ )
> { HaOpen[ j ] = 0.5 * HaClose[ j-1 ] + 0.5 * HaOpen[  j - 1 ]; }
> color=IIf (haClose > haOpen, colorGreen,colorRed);
>
> for( i = f; i < BarCount; i++ )
> {
> n=0;
> while (n<f)
> {
> temp=   IIf (haOpen <= Max(haOpen[i-n],haClose[i-n]) AND
>     haOpen >= Min(haOpen[i-n],haClose[i-n]) AND
>     haClose <= Max(haOpen[i-n],haClose[i-n]) AND
>     haClose >= Min(haOpen[i-n],haClose[i-n]),
>     N
> ,0);     
> n++;
>       }
> }
> HaHigh = Max( H, Max( HaClose, HaOpen ) );
> HaLow = Min( L, Min( HaClose, HaOpen ) );
> PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), temp,
> styleCandle );
>
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
>
>
>
> SPONSORED LINKS
> Investment management software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ> 
> 	Real estate investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA> 
> 	Investment property software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw> 
>
> Software support 
> <http://groups.yahoo.com/gads?t=ms&k=Software+support&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w> 
> 	Real estate investment analysis software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+analysis+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw> 
> 	Investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "amibroker
>       <http://groups.yahoo.com/group/amibroker>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>