Fishnet Moving Averages with step

Category: Indicators By: Nicolas Created: June 26, 2018, 12:51 PM
June 26, 2018, 12:51 PM
Indicators
3 Comments

This version of the Guppy multiple moving average indicator is dynamic. Thanks to the different parameters that I have integrated, you can choose the first and the last period of moving averages that you want to draw on the graph.
The variable “periodstep” allows to choose the step between each period of moving average. For example, using a “minperiod” of 20 and a “maxperiod” of 100, with a step of 5, you will have (100-20) / 5 = 16 moving averages displayed.
The transparency of moving averages is adjustable with the variable “alpha”.

The colors of the MA are divided into 3: the shortest, the median periods and the longest periods, in order to better visualize the behavior of the market.

//PRC_PRC_Fishnet MA with step | indicator
//26.06.2018
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

//--- settings
minperiod = 20
maxperiod = 200
stepperiod = 5
MAtype = 0
alpha = 50
//--- end of settings

segment = (maxperiod-minperiod)/3
r=255
g=81
b=38

for i = minperiod to maxperiod do
 avg = average[i,MAtype](customclose)
 if(i>segment) then 
  r=38
  g=167
  b=255
 endif
 if(i>segment*2) then 
  r=178
  g=58
  b=238
 endif
 drawtext(".",barindex,avg,Dialog,Bold,20) coloured(r,g,b,alpha)
 i = i+stepperiod
next

RETURN

 

Download
Filename: PRC_Fishnet-MA-with-step.itf
Downloads: 321
Download
Filename: fishnet-moving-average-indicator.png
Downloads: 119
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...