Amibroker-OLE-Interface
view release on metacpan or search on metacpan
t/test_afl.afl view on Meta::CPAN
else {
GfxSelectFont("Times New Roman", 24, 600, True );
GfxSetBkMode( colorRed );
GfxSetTextColor( colorWhite );
GfxTextOut(STOCK_NAME, 280 , 40 );
}
// Summary: Plot buy and sell spots on the graph for visual display
// Does not return anything
function plot_buy_sell_signals(type, upturn, downturn) {
// Filling the entire background color to black...Default is black + Grey
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("titleblock",colorBlack));
if(type == "Long") {
// To Plot Buy signal and box around it
PlotShapes(IIf(upturn, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-30);
PlotShapes(IIf(upturn, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(upturn, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-35);
// To Plot Sell signal and box around it
PlotShapes(IIf(downturn, shapeSquare, shapeNone),colorWhite, 0, L, Offset=-30);
t/test_afl.afl view on Meta::CPAN
PlotShapes(IIf(upturn, shapeSquare, shapeNone),colorYellow, 0, H, Offset=30);
PlotShapes(IIf(upturn, shapeSquare, shapeNone),colorYellow, 0,H, Offset=40);
PlotShapes(IIf(upturn, shapeDownArrow, shapeNone),colorBlue, 0,H, Offset=-35);
}
}
// Summary: Function to draw the chart on the screen
// Does not return anything
function draw_chart() {
SetChartOptions (0, chartShowArrows|chartShowDates); //set/clear/overwrite defaults for chart pane options
SetChartBkColor(colorDarkGrey); // Sets chart background to user-defined colour
// Plot the price chart
Plot( Close, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Plot( EMA( Close, 7 ), "", colorYellow, ParamStyle("Style", styleThick | styleLine | styleNoLabel ) | styleNoRescale );
Plot( EMA( Close, 30 ), "", colorWhite, ParamStyle("Style", styleThick | styleLine | styleNoLabel ) | styleNoRescale );
TimeFrameRestore(); // To get back to original interval
}
_SECTION_BEGIN("Trading Terminal");
draw_chart();
( run in 0.826 second using v1.01-cache-2.11-cpan-d8267643d1d )