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

[amibroker] candle color, price and macd


  • Date: Tue, 22 Dec 2009 22:15:00 -0800 (PST)
  • From: Deepak Patade <deepakpatade@xxxxxxxxx>
  • Subject: [amibroker] candle color, price and macd

PureBytes Links

Trading Reference Links

Can you helpme in this
Plot the color of candle green if MACD is above signal line
and
Plot the candle red when signal line is above green line.
 
Price

("Price");

SetChartOptions(0,chartShowArrows|chartShowDates);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )

{

ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));

}

 
 
macd

r1 = Param( "Fast avg", 12, 2, 200, 1 );

r2 = Param( "Slow avg", 26, 2, 200, 1 );

r3 = Param( "Signal avg", 9, 2, 200, 1 );

Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorBlue ), ParamStyle("MACD style") );

Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorRed ), ParamStyle("Signal style") );

Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );


 
Deepak Patade,
Nasik.