Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
FXcoder
MQL4-MQL5 Migration Example - StdDev
Commits
23e26013
Commit
23e26013
authored
Oct 13, 2019
by
FXcoder
Browse files
new mql4
parent
326dfdbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
StdDev/StdDev.mq4
StdDev/StdDev.mq4
+7
-10
No files found.
StdDev/StdDev.mq4
View file @
23e26013
...
...
@@ -13,10 +13,10 @@
#property indicator_color1 Blue
//---- input parameters
extern
int
ExtStdDevPeriod
=
20
;
extern
int
ExtStdDevMAMethod
=
0
;
extern
int
ExtStdDevAppliedPrice
=
0
;
extern
int
ExtStdDevShift
=
0
;
input
int
ExtStdDevPeriod
=
20
;
input
int
ExtStdDevMAMethod
=
0
;
input
int
ExtStdDevAppliedPrice
=
0
;
input
int
ExtStdDevShift
=
0
;
//---- buffers
double
ExtStdDevBuffer
[];
...
...
@@ -24,7 +24,7 @@ double ExtStdDevBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int
i
nit
()
void
OnI
nit
()
{
string
sShortName
;
...
...
@@ -44,15 +44,12 @@ int init()
//---- first values aren't drawn
SetIndexDrawBegin
(
0
,
ExtStdDevPeriod
);
//----
return
(
0
);
}
//+------------------------------------------------------------------+
//| Standard Deviation |
//+------------------------------------------------------------------+
int
start
(
)
int
OnCalculate
(
const
int
rates_total
,
const
int
prev_calculated
,
const
datetime
&
time
[],
const
double
&
open
[],
const
double
&
high
[],
const
double
&
low
[],
const
double
&
close
[],
const
long
&
tick_volume
[],
const
long
&
volume
[],
const
int
&
spread
[]
)
{
int
i
,
j
,
nCountedBars
;
double
dAPrice
,
dAmount
,
dMovingAverage
;
...
...
@@ -86,7 +83,7 @@ int start()
}
//----
return
(
0
);
return
(
rates_total
);
}
//+------------------------------------------------------------------+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment