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

Weekly MACD Signal with 5 ROC on Daily Charts for Amibroker (AFL)

Rating:
2 / 5 (Votes 3)
Tags:
oscillator, amibroker

Weekly MACD Signal with 5 ROC on Daily Charts

Add this code to ANY indicator you like. To be used in “Indicator” in AB
This code will approximate A Weekly ROC of MACD ( see seperate code for an
weekly indicator in the AB Files ). There is NO PRESENTATION of A GRAPH.
The results will give a text readout during “Daily” presentation of what the // weekly trend is doing.

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh over 12 years ago
Trading Volume Statistic
Submitted by tuanstock1 almost 10 years ago
Ergodic Oscillator
Submitted by dljtrader over 13 years ago
3 Days Track
Submitted by janet0211 almost 14 years ago
Chande Momentum Oscillator
Submitted by klimpek over 13 years ago

Indicator / Formula

Copy & Paste Friendly
/*  Text of Weekly MACD Signal with 5 ROC on Daily Charts 
    INSTRUCTIONS AT END OF CODE  */

weeklyprice=C;
Weekly=ValueWhen(DayOfWeek() > Ref( DayOfWeek(),1),WeeklyPrice);

W6ema = EMA(weekly,30);// 6 weeks * 5 days per week
W13ema = EMA(weekly,65);// 13 weeks * 5 days per week
MACDSignal = EMA((W6ema - W13ema),25);// 5 weeks * 5 days per week

ROCMACD = MACDSignal - Ref(MACDSignal,-25);//ROC of MACD Signal

//Cond1 - "V" bottom, start of climb
Cond1 = IIf(ROCMACD > Ref(ROCMACD,-5)  AND Ref(ROCMACD,-5) <= Ref(ROCMACD,-10),1,0);
//Cond2 - "V" top, start of drop
Cond2 = IIf(ROCMACD < Ref(ROCMACD,-5)   AND Ref(ROCMACD,-5) >= Ref(ROCMACD,-10),1,0);
//cond3 - Steady up trend
Cond3 = IIf(ROCMACD> Ref(ROCMACD,-5) AND Ref(ROCMACD,-5) >= Ref(ROCMACD,-10),1,0);
//Cond4 - Steady down trend
Cond4 = IIf(ROCMACD < Ref(ROCMACD,-5) AND Ref(ROCMACD,-5) <= Ref(ROCMACD,-10),1,0);
//Cond5 - no change - flat
Cond5 = IIf(ROCMACD = Ref(ROCMACD,-5) ,1,0);

Title = Title + "        Weekly -"  
 + WriteIf(Cond1," NEW UP TREND  ", WriteIf(Cond2," NEW DOWN TREND   ", WriteIf(Cond3," Trend is Up    ",WriteIf(Cond4,"  Trend is Down    ",WriteIf(Cond5,"    Trend is Flat    ","")))));

//  Add this code to ANY indicator you like.  To be used in "Indicator" in AB
//  This code will approximate A Weekly ROC of MACD ( see seperate code for an
//  weekly indicator in the AB Files ).  There is NO PRESENTATION of A GRAPH.  
//  The results will give a text readout during "Daily" presentation of what the       //  weekly trend is doing.

4 comments

1. Kabir

Error

Title = Title + " Weekly -"

2. anandnst

AFL NOT WORKING….IN 5.40 AMIBROKER VERSION. ADMIN PL HELP FOR CODING.

3. joeoil

In line 22 I think there should be:
Condi5 = IIf(ROCMACD == Ref(ROCMACD,-5) ,1,0);

In line line 24 I think there should be:
Title = Name() + " Weekly -"

Then you will not get an error message.

4. shaker128

Error …. please check

Leave Comment

Please login here to leave a comment.

Back