stephane2.0

MACD CCI Overlay

Category: Indicators By: stephane2.0 Created: February 20, 2020, 1:11 PM
February 20, 2020, 1:11 PM
Indicators
5 Comments
MACD CCI Overlay

Paint the candlesticks with conditions based on CCI and MACD.

  • green color when  cci [14] > 0 and macd line > signal line
  • red color when cci [14] < 0 and macd line < signal line
  • grey color when cci > 0 and macd line< signal line or cci < 0 and macd line> signal line
// Variable

a=CCI[14](typicalPrice)
b=MACDline[12,26,9](close)
c = ExponentialAverage[9](b)


//Hausse
if a > 0 and b > c then
r = 0
b = 0
g = 255

//Baisse
elsif a < 0 and b < c then
r = 255
b = 0
g = 0

//Neutre
elsif a > 0 and b < c OR a < 0 and b > c then
r = 195
g = 195
b = 195
endif

DRAWCANDLE(open,high,low,close) coloured(r,g,b)
 
RETURN

Download
Filename: MACD-CCI-overlay.itf
Downloads: 265
stephane2.0
stephane2.0 Junior
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

stephane2.0
4 years ago
#

line 22: r = 195 by r = 0 line 23: g = 195 by g = 0 line 24: b = 195 by b = 255 ;)

Forexcheckup
4 years ago
#

Hi I down loaded the ITF file, it paints red for a down trend but for all up trends the candles are grey. Could you advise how I get the candles to paint blue please

stephane2.0
7 years ago
#

c=exponentialaverage[9](MACDLine[12,26,9](close))

stephane2.0
7 years ago
#

Yes, line 5 is truncated. I can't edit, please replace by:

cfta
7 years ago
#

Thanks for sharing, this may be a useful filter but I'm not sure if it's coded correctly since I only get red and gray candles but never any green ones regardless of which instrument and timeframe I try it on.

ProRealCode ProRealCode
Loading...