Commit b3f553cc authored by FXcoder's avatar FXcoder

OnInit

parent 23e26013
......@@ -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 + ")";
IndicatorShortName(sShortName);
IndicatorSetString(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
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment