Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
M
MQL4-MQL5 Migration Example - StdDev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
FXcoder
MQL4-MQL5 Migration Example - StdDev
Commits
b3f553cc
Commit
b3f553cc
authored
Oct 13, 2019
by
FXcoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OnInit
parent
23e26013
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
StdDev/StdDev.mq4
StdDev/StdDev.mq4
+29
-1
No files found.
StdDev/StdDev.mq4
View file @
b3f553cc
...
...
@@ -10,6 +10,7 @@
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_buffers 1
#property indicator_plots 1
#property indicator_color1 Blue
//---- input parameters
...
...
@@ -30,6 +31,7 @@ void OnInit()
//---- indicator buffer mapping
SetIndexBuffer
(
0
,
ExtStdDevBuffer
);
ArraySetAsSeries
(
ExtStdDevBuffer
,
true
);
// for 5
//---- indicator line
SetIndexStyle
(
0
,
DRAW_LINE
);
...
...
@@ -39,7 +41,7 @@ void OnInit()
//---- name for DataWindow and indicator subwindow label
sShortName
=
"StdDev("
+
(
string
)
ExtStdDevPeriod
+
")"
;
IndicatorS
hortName
(
sShortName
);
IndicatorS
etString
(
INDICATOR_SHORTNAME
,
sShortName
);
SetIndexLabel
(
0
,
sShortName
);
//---- first values aren't drawn
...
...
@@ -131,5 +133,31 @@ double GetAppliedPrice(int nAppliedPrice, int nIndex)
//----
return
(
dPrice
);
}
#ifndef __MQL4__
// only 2 arguments for example
void
SetIndexStyle
(
int
index
,
int
type
)
{
PlotIndexSetInteger
(
index
,
PLOT_DRAW_TYPE
,
type
);
}
void
SetIndexShift
(
int
index
,
int
shift
)
{
PlotIndexSetInteger
(
index
,
PLOT_SHIFT
,
shift
);
}
void
SetIndexLabel
(
int
index
,
string
text
)
{
PlotIndexSetString
(
index
,
PLOT_LABEL
,
text
);
}
void
SetIndexDrawBegin
(
int
index
,
int
begin
)
{
PlotIndexSetInteger
(
index
,
PLOT_DRAW_BEGIN
,
begin
);
}
#endif
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
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