Small algo help required

#1
I want you to write a small programme .Make an indicator ...where there is zero line the formula for that is F / K
Where F is the difference between closing prices of 2 bars ( daily or weekly or hourly )
K is the difference in price and its 20 days Simple Moving Average
i.e. how far away the price is from its 20 DSMA .
Can anybody help me make this indicator in AMIBROKER 5.6 version
 

GTji

Active Member
#2
I want you to write a small programme .Make an indicator ...where there is zero line the formula for that is F / K
Where F is the difference between closing prices of 2 bars ( daily or weekly or hourly )
K is the difference in price and its 20 days Simple Moving Average
i.e. how far away the price is from its 20 DSMA .
Can anybody help me make this indicator in AMIBROKER 5.6 version
It would probably be something like

F=abs(ref(c,-1)-ref(c,-2));//diff bet closing prices.
K=abs(c-ma(ref(c,-1),20));// diff bet sma and current price.
FK=F/K;// you can plot this on the graph or do whatever you want to do with this, how to plot? look up in AB help file;
 
#3
Need afl to detect MACD divergence. When Close of Price is higher than previous and MACD value is lower in last 26 bars it should show on chart
or should come in Exploration.
Same for RSI . When Close of Price is higher than previous Close and RSI value is lower in last 14 bars it should show on chart or should
come in Exploration. Also for RSI if previous RSI is above 70 and next in 14 bars if RSI is below 70 and price close is higher it should
come in Exploration.
Thanks
God Bless You
 
#4
It would probably be something like

F=abs(ref(c,-1)-ref(c,-2));//diff bet closing prices.
K=abs(c-ma(ref(c,-1),20));// diff bet sma and current price.
FK=F/K;// you can plot this on the graph or do whatever you want to do with this, how to plot? look up in AB help file;
Thanks a lot for your suggestion.

Need afl to detect MACD divergence. When Close of Price is higher than previous and MACD value is lower in last 26 bars it should show on chart
or should come in Exploration.
Same for RSI . When Close of Price is higher than previous Close and RSI value is lower in last 14 bars it should show on chart or should
come in Exploration. Also for RSI if previous RSI is above 70 and next in 14 bars if RSI is below 70 and price close is higher it should
come in Exploration.
Thanks
God Bless You
 

Similar threads