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

Re: [amibroker] colored indicators



PureBytes Links

Trading Reference Links

Hi,

Thank you for posting this Marcel.
Just one comment:
In case of MACD color graph could be achieved in a simpler
way:
/* Colourized Macd drawn here*/
Graph0BarColor = IIF( macd() > signal(), 5, 4 );

A "strange" ValueWhen( vBarcolor != 0, vBarColor ); from the
original code for price bars was needed to ensure
that Inside bars (vBarcolor==0) get the same color as preceding 
(non-inside) bar.

Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com


----- Original Message ----- 
From: "HCCNet Arnhem" <m.temming@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, April 20, 2001 11:18 PM
Subject: [amibroker] colored indicators


> Hi Jeff,
> 
> I 'm interested in the colors too.
> So I tried to modify Thomaz MACD() indicator into a colored indicator. And
> i'm sucseeded.
> The fast line colors 'green' when crossing the signal upwards (Long) and
> 'red' when crossing signal downwards (Short).
> You can use this indicator in the indicator builder (you get the colors) and
> in the commentary it gives the buy and sell signals.
> 
> --------- first
> example --------------------------------------------------------
> ./* Project: AmiBroker
> ** File: macd.afl
> ** Title: MACD Color
> ** Requirements: AFL 1.1 (AmiBroker 3.0) or above
> ** Written by: Tomasz Janeczko
> Last modified 18 Apr 2001 (Color)
> Marcel Temming
> */
> 
> vLong = Cross(Macd(), Signal()) ;
> vShort = Cross(Signal(), Macd()) ;
> 
> Title = Name() + " - MACD (12,26,9) = " + WriteVal(Macd(), 3.2) + ", Signal
> = " + WriteVal(Signal(), 3.2);
> Graph0 = Macd() ;
> Graph0Style = 1;
> Graph1 = Signal() ;
> Graph1Style = 1+4;
> graph2 = graph0 - graph1;
> 
> /* Colourized Macd drawn here*/
> vBarColor = IIF( vLong, 5, IIF(vShort,4,0) ) ;
> Graph0BarColor = ValueWhen( vBarcolor != 0, vBarColor );
> 
> Buy = vLong ;
> Sell = vShort ;
> 
> "Review of " + fullname() + " (" + name() + ")" + "\nas of " + date();
> 
> "\nCurrent Statistics\n";
> "Close: " + WriteVal(Close);
> "Change: " + WriteVal(Close - Ref( Close, -1 ) ) ;
> "MACD Value: " + WriteVal(MACD());
> "Signal Line: " + WriteVal(SIGNAL());
> 
> "\n\nThis commentary is not a recommendation to buy or sell, but rather a
> guideline to interpreting the specified indicators. This information should
> only be used by investors who are aware of the risk inherent in securities
> trading. The author accepts no liability whatsoever for any loss arising
> from any use of this expert or its contents.";
> ---------second
> example --------------------------------------------------------
> In this second example I modified the ZigZag indicator into a colored
> indicator.
> 'Green' for the uptrend and 'red' for the downtrend.
> You can use this indicator in the indicator builder (you get the colors) and
> in the commentary it gives the buy and sell signals.
> 
> 
> /* Zig() function
> 
> Color ZigZag chart
> Last modified 16 Apr 2001(Colors)
> Marcel Temming
> AFL implementation by
> (C)2001 Tomasz Janeczko
> */
> 
> vPeriod = 8 ;
> vOutsideBar = OutSide();
> vInsideBar = H <= Ref( H, -1 ) AND L >= Ref( L, -1 );
> vZigZag = Zig( Close, vPeriod ) ;
> 
> vUpBar = vZigZag >= Ref( vZigZag , -1 );
> vDownBar = vZigZag <= Ref( vZigZag , -1 );
> 
> Title = Name() + " - ZigZag (Close," + WriteVal( vPeriod, 2.0) +") = " +
> WriteVal(vZigZag, 4.2);
> 
> Graph1 = Close ;
> Graph1Style = 4 ; /* Thick */
> Graph0 = vZigZag ;
> Graph0Style = 4 ; /* Thick */
> 
> /* Colourized ZigZag drawn here*/
> vBarColor = IIF( vOutSideBar, 1, IIF( vDownBar, 4, IIF( vUpBar, 5, 0 ) ) );
> Graph0BarColor = ValueWhen( vBarcolor != 0, vBarColor );
> 
> Buy = Trough( Close,vPeriod,1 ) == Close ;
> Sell = Peak( Close,vPeriod,1) == Close ;
> 
> "\n\nThis commentary is not a recommendation to buy or sell, but rather a
> guideline to interpreting the specified indicators. This information should
> only be used by investors who are aware of the risk inherent in securities
> trading. The author accepts no liability whatsoever for any loss arising
> from any use of this expert or its contents.";
> ----------------------------------------------------------------------------
> -------------
> I 'm planning to modify the RSI() too.
> 
> Marcel Temming
> 
> 
> -----Oorspronkelijk bericht-----
> Van: Jeff Gholson [mailto:jgholson@x...]
> Verzonden: vrijdag 20 april 2001 20:14
> Aan: amibroker@xxxxxxxxxxxxxxx
> Onderwerp: RE: [amibroker] Re: Example screen and system test Williams
> New Dimensions in Trading system
> 
> 
> I am not really interested in Steve's system, more so his use of the change
> in colors on the various charts, indicators, volume, etc....
> 
> Jeff Gholson
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
>