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

RE: [amibroker] Re: Colored Lines



PureBytes Links

Trading Reference Links

Okay, I tried your code. The intervening dots don't actually exist
because you have done weekly get prices, they are being filled by code
that plugs holes and thus are not compared in your color test.

Try setting the timeframe to inWeekly first.
Compute your weekly averages and PP
Restore the timeframe
Then do

PPD = TimeFrameExpand(PP,inWeekly); //Check my syntax here!

Then the plot colors should work as now there are dots for every day.
--
Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of cyclicaltrader
Sent: Sunday, August 13, 2006 20:40
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Colored Lines

Hi Terry and thanks for the reply

I must be missing something.  "PP" is the calculation of the pivot. 
What do you mean by saying "actual"?  Even if I remove the dotted line
and let the pivot draw as a simple line, it will still don't color
properly.

Thanks for the help and i appreciate any help you can provide

Costas

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxx> wrote:
>
> Costas,
> 
>  
> 
> I don't see where you apply the same logic to any dotted line.
> 
>  
> 
> Try this:
> 
>  
> 
> Color = IIf(PP
>
>Ref(PP,-1),colorBrightGreen,IIf(PP<Ref(PP,-1),colorDarkRed,colorWhite))
> ;
> 
> Plot(PP, "",color,styleDots+styleNoLabel);
> 
> Plot(xxx,"",color,stylexyz); //Where this is your "actual pivot" plot
> 
> --
> 
> Terry
> 
>  
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf Of cyclicaltrader
> Sent: Sunday, August 13, 2006 16:47
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Colored Lines
> 
>  
> 
> Hi,
> 
>  
> 
> I took a piece of code I found in the AFL library and modified it to
> 
> add coloring.  For some reason something doesn't work right.
> 
>  
> 
> The code is the following:
> 
>  
> 
> ---------------------------------------
> 
>  
> 
> WeekH = TimeFrameGetPrice("H", inWeekly, -1);
> 
> WeekL = TimeFrameGetPrice("L", inWeekly, -1);
> 
> WeekC = TimeFrameGetPrice("C", inWeekly, -1);
> 
> WeekO = TimeFrameGetPrice("O", inWeekly);
> 
>  
> 
> PP = (WeekH + WeekL + WeekO + WeekO) / 4 ;
> 
>  
> 
> Plot(PP, "",IIf(PP >Ref(PP,-1),colorBrightGreen,           
> 
> IIf(PP<Ref(PP,-1),colorDarkRed,colorWhite)),styleDots+styleNoLabel);
> 
>  
> 
> -------------------------------------------
> 
>  
> 
> The line changes from red to green and visa versa depending if the
> 
> weekly pivot is higher (or lower) than last week's pivot.  But the
> 
> dotted line (which is the actual pivot) doesn't hold the green or red
> 
> color. The "colorwhite" was added just to complete the IIF statement.
> 
>  
> 
> The pivot should be either red or green.
> 
>  
> 
> Thanks in advance
> 
>  
> 
> Costas
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 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
> 
>  
> 
>  
> 
> Yahoo! Groups Links
> 
>  
> 
>     http://groups.yahoo.com/group/amibroker/
> 
>  
> 
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>  
> 
>     http://docs.yahoo.com/info/terms/
>






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

 
Yahoo! Groups Links