#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Home
Forex Forum
+ Add Script
Metastock
Expert Advisors
Explorations
Indicators
Trading Systems
Metatrader
MQL Experts
MQL Indicators
MQ4 Experts
MQ4 Indicators
MQ4 Scripts
Tradestation
Functions
Indicators
PaintBars
ShowMe
Trading Systems
Amibroker
Commentaries
Explorations
Functions
Indicators
Trading Systems
Contact us
Newsletter
Group: Metatrader MQ4 Indicators
Title: EVWMA
Description:
EVWMA
//+------------------------------------------------------------------+ //| EVWMA | //| Copyright © 2004, Poul_Trade_Forum | //| Aborigen | //| http://forex.kbpauk.ru/ | //+------------------------------------------------------------------+ #property copyright "Poul Trade Forum" #property link "http://forex.kbpauk.ru/" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 DeepPink extern int VolumeDivisor=1; extern int N=100; double ScaledVol=0, VolDiff=0; double X[100], Y[100]; bool Violation=false; //---- buffers double EVWMA[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line SetIndexStyle(0,DRAW_LINE,EMPTY,2,DeepPink); SetIndexBuffer(0,EVWMA); SetIndexEmptyValue(0,0); //---- name for DataWindow and indicator subwindow label short_name="EVWMA"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,1); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(),i,shift,count; if (counted_bars==0) {EVWMA[Bars] = Close[Bars]; counted_bars=1;} i=(Bars-counted_bars); for (shift=i; shift>=0;shift--) { ScaledVol = Volume[shift]/VolumeDivisor; VolDiff = N - ScaledVol; if ( VolDiff<0 && Violation==false) Violation = true; if (Violation==true) EVWMA[shift]=EVWMA[shift+1]; else EVWMA[shift] = (VolDiff * EVWMA[shift+1] + ScaledVol * Close[shift]) / N ; Violation=false; //---- } return(0); } //+------------------------------------------------------------------+
Author/Source:
Aborigen
Forex Directory
|
Forex Trading Systems
|
Privacy
|
Disclaimer
|
Contact