Cloud indicator

Category: Indicators By: Nicolas Created: November 21, 2019, 10:31 AM
November 21, 2019, 10:31 AM
Indicators
8 Comments

The Cloud indicator distinguish the relationship between 2 moving average and thus determines the color of the cloud.

We distinguish 4 cases:

  • Short & Long Growing
  • Growing Short & Long Falling
  • Falling Short & Long Growing
  • Short & Long Falling

Cloud indicator code has been converted following a request in the french ProBuilder forum: Indicateur CLOUD conversion code mq4 vers prorealtime

//PRC_Cloud Indicator | indicator
//21.11.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 code

// --- settings
FastAveragePeriod = 50
FastMAMethod = 1 //MA type (0=SMA,1=EMA,2=WMA,3=Wilder,4=Triangular,5=End point,6=Time series)
SlowAveragePeriod = 200
SlowMAMethod = 0 //MA type (0=SMA,1=EMA,2=WMA,3=Wilder,4=Triangular,5=End point,6=Time series)
alpha = 100 //alpha transparency of color fill
// --- end of settings

FastMA = average[FastAveragePeriod,FastMAMethod](customclose)
SlowMA = average[SlowAveragePeriod,SlowMAMethod](customclose)

maxma = Max(FastMA,SlowMA)
minma = Min(FastMA,SlowMA)

if (FastMA >= SlowMA)then
 if (FastMA >= FastMA[1])then
  r=0
  g=128
 else
  r=0
  g=255
 endif
else
 if (FastMA >= FastMA[1])then
  r=255
  g=165
 else
  r=255
  g=0
 endif
endif

drawcandle(maxma,minma,maxma,minma) coloured(r,g,0,alpha) bordercolor(100,100,100,0)

return FastMA, SlowMA

 

Download
Filename: PRC_Cloud-Indicator.itf
Downloads: 540
Nicolas Master
Trader, Programmer, Coder enthusiast. Work with each other for a common goal.
Author’s Profile

Comments

Logo Logo
Loading...