Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Time Frame Base 3 Averages Signals for Amibroker (AFL)

Rating:
0 / 5 (Votes 0)
Tags:
AFL, Time Frame, EMA, signal

Instead of Plotting Complex Averages like Road Traffic of Chandani Chowk, the TF Based Signals can keep chart clean. You can also add scanner, which I have not added.
.
I have seen some similar code earlier, but that was having repeated separate code for each Averages and for each Time Frame, due to which code was very Big.
I converted it for common single function that Takes parameters for users selected Time Frames.

.
You just have to Call Function with Different TF parameter and add additional Pixel length so all signals will get printed on screen one after another horizontally.

Screenshots

Indicator / Formula

Copy & Paste Friendly

Apply to Price Chart( it has Price Chart already) Toggle Display of Average with Default setting or with parameter

// By Mr. Abhimanyu Y. Altekar  abhimanyu.altekar@gmail.com
// 19th September 2024 V1.0
Hor=Param("Horizontal Position",5,20,1200,1);
Ver=Param("Vertical Position",70,30,1000,1);
IsPlot = ParamToggle ("Plot all Averages", "No|Yes",1);
SetChartOptions(0,chartShowDates|chartShowArrows|chartWrapTitle);
SetChartBkGradientFill( ParamColor("BgTop", colorLightGrey),ParamColor("BgBottom", colorTan),ParamColor("titleblock",colorLightGrey)); 
gxs=Param("GRAPH spaceing",5,5,50,5); 
GraphXSpace = gxs;
_SECTION_BEGIN( "Price" );	
GraphLabelDecimals = 2;
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle(),0,0,0,1 ); ;
_SECTION_END();
//5m
function xSignal(Tf,Hor,Ver,sTf,isPlot)
{
TimeFrameSet(TF);
e10=EMA(C,10);
e20=EMA(C,20);
e30=EMA(C,30);
TimeFrameRestore();
ex10=TimeFrameExpand( e10, TF,expandLast );
ex20=TimeFrameExpand( e20, TF,expandLast );
ex30=TimeFrameExpand( e30, TF,expandLast );
if(isPlot)
{
Plot(ex10,"\n"+sTf,colorGreen,styleThick);
Plot(ex20,sTf,colorBlue,styleThick);
Plot(ex30,sTf,colorOrange,styleThick);
}
sOK=WriteIf(ex10>ex20 OR ex10<ex30,"Ok" ,"Flat" );
sGood=WriteIf(ex10>ex20 AND ex10>ex30,"Good " ,"Flat" );
sBad=WriteIf(ex10<ex20 AND ex10<ex30,"Bad " ,"Flat" );

if(sOK=="Ok" )
GfxSelectSolidBrush(colorGold);
PlotShapes(shapeCircle,colorGold,0,1,1,5);
if(sGood=="Good " )
GfxSelectSolidBrush(colorBrightGreen);
if(sBad=="Bad " )
GfxSelectSolidBrush(colorRed);
GfxTextOut(sTF,Hor+70, Ver-15);
GfxRectangle( Hor+70,Ver+5,Hor+100,Ver+15 );

}
//IsPlot = ParamToggle ("Plot all Averages", "No|Yes",0);
xSignal(in5Minute,Hor,Ver,"5M",True); // Buy Defailt Plotting On
xSignal(in15Minute,Hor+40,Ver,"15M",isPlot); // Selected As per isPlot
xSignal(in15Minute*2,Hor+85,Ver,"30M",isPlot); // Selected As per isPlot
xSignal(inHourly,Hor+125,Ver,"1 H",True); // Buy Defailt Plotting On
xSignal(inHourly*2,Hor+165,Ver,"2 H",isPlot);// Selected As per isPlot
xSignal(inHourly*4,Hor+205,Ver,"4 H",isPlot);// Selected As per isPlot
xSignal(inDaily,Hor+245,Ver,"Daily",isPlot);// Selected As per isPlot

0 comments

Leave Comment

Please login here to leave a comment.

Back