كيف يمكنني التقاط قيمة O [_I] من هذا indior إلى EA.
O [_] هو السعر المفتوح لمخطط التراكب الداخلي.
Inserted Code/ --------------------------------------------- --------------------- /| OverlayChart.mq5 |/| حقوق الطبع والنشر 2014-2016 ، EarnForex.com |/| http://www.earnforex.com |/| تم التحويل من إصدار MT4 بواسطة http://www.irxfx.com |/ ----------------------------------------------- ------------------- # حقوق الملكية الفكرية حقوق الطبع والنشر 2014-2016 ، EarnForex.com #property Hyperlink http://www.earnforex.com #property version 1.01 #property indior_chart_window #property indior_buffers 5 #property indior_plots 1 #property indior_type1 DRAW_COLOR_BARS #property indior_color1 clrMediumSeaGreen، clrOrange #property indior_width1 1/Indior Parameters input string SubSymbol = GBPUSD؛ bool Mirroring = false؛ إدخال ENUM_DRAW_TYPE DrawType = DRAW_COLOR_BARS ، لون المدخلات GridColor = clrBlack؛/Indior Buffers double O # 91؛ # 93 ؛؛ double H # 91؛ # 93 ؛؛ مزدوجة L # 91 ؛ # 93 ؛؛ double C # 91؛ # 93 ؛؛ مزدوج اللون # 91 ؛ # 93 ؛؛/Global variables double SubOpen # 91؛ # 93 ؛؛ double SubHigh # 91؛ # 93 ؛؛ double SubLow # 91؛ # 93 ؛؛ double SubClose # 91؛ # 93 ؛؛ string prefix = OverlayChart؛/Indior Prefix int Grid = 10؛/Grid Lines int SnapPips = 10؛/Snap Pips For Grid Lines/ ---------------------------------------- -------------------------- /| وظيفة التهيئة الأولية المخصصة |/ ----------------------------------------------- ------------------- int OnInit () IndiorSetString (INDICATOR_SHORTNAME، OverLay Chart ( SubSymbol ))؛ SetIndexBuffer (0، O، INDICATOR_DATA)؛ SetIndexBuffer (1، H، INDICATOR_DATA)؛ SetIndexBuffer (2، L، INDICATOR_DATA)؛ SetIndexBuffer (3، C، INDICATOR_DATA)؛ SetIndexBuffer (4 ، اللون ، INDICATOR_COLOR_INDEX) ؛ ArraySetAsSeries (O، true)؛ ArraySetAsSeries (H، true)؛ ArraySetAsSeries (L، true)؛ ArraySetAsSeries (C، true)؛ ArraySetAsSeries (اللون ، صحيح) ؛ PlotIndexSetDouble (0، PLOT_EMPTY_VALUE، 0)؛ PlotIndexSetInteger (0 ، PLOT_DRAW_TYPE ، DrawType) ؛ ArraySetAsSeries (SubOpen ، صحيح) ؛ ArraySetAsSeries (SubHigh، true)؛ ArraySetAsSeries (SubLow، true)؛ ArraySetAsSeries (SubClose، true)؛ العودة (INIT_SUCCEEDED)؛/ ----------------------------------------------- ------------------- /| وظيفة مخصصة disinetialization |/ ----------------------------------------------- ------------------- void OnDeinit (const int int) ObjectsDeleteAll (0، Prefix)؛* for (int _I = 1؛ _I lt؛ = Grid؛ _I ) ObjectDelete (0، Prefix Grid IntegerToString (_I))؛ ObjectDelete (0 ، والبادئة سعر IntegerToString (_I)) ؛ */ --------------------------------------------- --------------------- /| وظيفة التكرار indord مخصصة |/ ----------------------------------------------- ------------------- int OnCalculate (const int rates_total، const int prev_calculated، const datetimeTime # 91؛ # 93 ؛، const double Open # 91؛ # 93 ؛، const double High # 91؛ # 93 ؛، const double Low # 91؛ # 93 ؛، const double Close # 91؛ # 93 ؛، const long tick_volume # 91؛ # 93 ؛، const long volume # 91؛ # 93 ؛، const int spread # 91؛ # 93؛ -RRB- int _BarsCount؛ double _CurRangeHigh، _CurRangeLow، _CurRangeCenter؛ double _SubRangeHigh، _SubRangeLow، _SubRangeCenter؛ مزدوجة _SubPoint؛ int _SubDigit؛ double _SubOpen، _SubHigh، _SubLow، _SubClose؛ double _PipsRatio؛ مزدوجة _GridPips ، _GridPrice ؛ الباحث _I ArraySetAsSeries (فتح ، صحيح) ؛ ArraySetAsSeries (عالية ، صحيح) ؛ ArraySetAsSeries (منخفض ، صحيح) ؛ ArraySetAsSeries (إغلاق ، صحيح) ؛ ArraySetAsSeries (الوقت ، صحيح) ؛ ArrayInitialize (O، 0)؛ ArrayInitialize (H، 0)؛ ArrayInitialize (L، 0)؛ ArrayInitialize (C، 0)؛/احسب الأشرطة المرئية _BarsCount = (int) ChartGetInteger (0، CHART_VISIBLE_BARS) 1؛ int _FirstBar = (int) ChartGetInteger (0، CHART_FIRST_VISIBLE_BAR)؛ int _LastBar = _FirstBar - _BarsCount 1؛ إذا كانت (_LastBar lt؛ 0) _LastBar = 0؛ _BarsCount = _FirstBar 1؛/Calculate Chart Ratio _CurRangeHigh = High # 91؛ ArrayMaximum (High، _LastBar، _BarsCount) # 93 ؛؛ _CurRangeLow = Low # 91؛ ArrayMinimum (منخفض ، _LastBar ، _BarsCount) # 93 ؛؛ _CurRangeCenter = (_CurRangeHigh _CurRangeLow)2؛ int ن ؛ n = CopyOpen (SubSymbol، 0، _LastBar، _BarsCount، SubOpen)؛ إذا (! CheckData (n، _BarsCount)) بإرجاع (0)؛ n = CopyHigh (SubSymbol، 0، _LastBar، _BarsCount، SubHigh)؛ إذا (! CheckData (n، _BarsCount)) بإرجاع (0)؛ n = CopyLow (SubSymbol، 0، _LastBar، _BarsCount، SubLow)؛ إذا (! CheckData (n، _BarsCount)) بإرجاع (0)؛ n = CopyClose (SubSymbol، 0، _LastBar، _BarsCount، SubClose)؛ إذا (! CheckData (n، _BarsCount)) بإرجاع (0)؛ double SubMax = SubHigh # 91؛ ArrayMaximum (SubHigh) # 93 ؛؛ double SubMin = SubLow # 91 ؛ ArrayMinimum (SubLow) # 93 ؛؛ if (Mirroring) _SubRangeHigh = SubMin؛ _SubRangeLow = SubMax؛ else _SubRangeHigh = SubMax؛ _SubRangeLow = SubMin؛ _SubRangeCenter = (_SubRangeHigh _SubRangeLow)2؛ _SubPoint = SymbolInfoDouble (SubSymbol ، SYMBOL_POINT)؛ _SubDigit = (int) SymbolInfoInteger (SubSymbol، SYMBOL_DIGITS)؛ if (_SubRangeHigh - _SubRangeLow == 0) return (0)؛ _PipsRatio = (_CurRangeHigh - _CurRangeLow)(_SubRangeHigh - _SubRangeLow)؛ _GridPips = (_SubRangeHigh - _SubRangeLow)الشبكة ؛ _GridPips = MathRound ((_ SubRangeHigh - _SubRangeLow)Grid(_SubPoint * SnapPips)) * (_SubPoint * SnapPips)؛/Draw Candlesticks for (_I = _LastBar؛ _I lt؛ _LastBar _BarsCount؛ _I ) int I = _I - _LastBar؛ _SubOpen = SubOpen # 91؛ I # 93؛ - _SubRangeCenter _SubHigh = SubHigh # 91؛ I # 93؛ - _SubRangeCenter _SubLow = SubLow # 91؛ I # 93؛ - _SubRangeCenter _SubClose = SubClose # 91؛ I # 93؛ - _SubRangeCenter إذا كان (Mirroring) إذا (_SubOpen lt؛ _SubClose)H # 91؛ _I # 93؛ = _CurRangeCenter _SubHigh * _PipsRatio؛ L # 91؛ _I # 93؛ = _CurRangeCenter _SubLow * _PipsRatio؛ اللون # 91؛ _I # 93؛ = 0 else L # 91؛ _I # 93؛ = _CurRangeCenter _SubLow * _PipsRatio؛ H # 91؛ _I # 93؛ = _CurRangeCenter _SubHigh * _PipsRatio؛ اللون # 91؛ _I # 93؛ = 1 ؛ C # 91؛ _I # 93؛ = _CurRangeCenter _SubClose * _PipsRatio؛ O # 91؛ _I # 93؛ = _CurRangeCenter _SubOpen * _PipsRatio؛ else if (_SubOpen lt؛ _SubClose) H # 91؛ _I # 93؛ = _CurRangeCenter _SubHigh * _PipsRatio؛ L # 91؛ _I # 93؛ = _CurRangeCenter _SubLow * _PipsRatio؛ اللون # 91؛ _I # 93؛ = 0 else L # 91؛ _I # 93؛ = _CurRangeCenter _SubLow * _PipsRatio؛ H # 91؛ _I # 93؛ = _CurRangeCenter _SubHigh * _PipsRatio؛ اللون # 91؛ _I # 93؛ = 1 ؛ C # 91؛ _I # 93؛ = _CurRangeCenter _SubClose * _PipsRatio؛ O # 91؛ _I # 93؛ = _CurRangeCenter _SubOpen * _PipsRatio؛ لـ (_I = 1؛ _I lt؛ = Grid؛ _I ) _GridPrice = MathRound (_SubRangeCenter(_SubPoint * SnapPips)) * (_SubPoint * SnapPips)؛ _GridPrice = ((_GridPrice _GridPips2) _GridPips * (الشبكة2 - 1)) - (_GridPips * (_I - 1))؛ string grid_string = البادئة الشبكة IntegerToString (_I)؛ ObjectCreate (0 ، grid_string ، OBJ_TREND ، 0 ، 0 ، 0)؛ ObjectSetInteger (0، grid_string، OBJPROP_TIME، 0، Time # 91؛ _FirstBar # 93؛ -RRB-؛ ObjectSetDouble (0، grid_string، OBJPROP_PRICE، 0، _CurRangeCenter (_GridPrice - _SubRangeCenter) * _PipsRatio)؛ ObjectSetInteger (0، grid_string، OBJPROP_TIME ، 1، Time # 91؛ _LastBar # 93؛ -RRB-؛ ObjectSetDouble (0، grid_string، OBJPROP_PRICE، 1، _CurRangeCenter (_GridPrice - _SubRangeCenter) * _PipsRatio)؛ ObjectSetInteger (0، grid_string، OBJPROP_COLOR، GridColor)؛ ObjectSetInteger (0 و grid_string و OBJPROP_STYLE و STYLE_DOT)؛ ObjectSetInteger (0، grid_string، OBJPROP_WIDTH، 1)؛ ObjectSetInteger (0، grid_string، OBJPROP_RAY_RIGHT، true)؛ grid_string = Prefix Price IntegerToString (_I)؛ ObjectCreate (0، grid_string، OBJ_TEXT، 0 0، 0)؛ ObjectSetInteger (0، grid_string، OBJPROP_TIME، 0، Time # 91؛ _FirstBar - _BarsCount10 # 93؛ -RRB-؛ ObjectSetDouble (0، grid_string، OBJPROP_PRICE، 0، _CurRangeCenter (_GridPrice - _SubRangeCenter) * _PipsRatio )؛ ObjectSetInteger (0 ، grid_string ، OBJPROP_COLOR ، GridColor)؛ ObjectSetString (0 ، grid_string ، OBJPROP_TEXT ، DoubleToString (_GridPrice، _SubDigit))؛ العودة (rates_total)؛/يقوم بفحص كمية أشرطة timeseries وإرجاعها إما true (OK) أو false (خطأ). Bool CheckData (int n، int _BarsCount) إذا (n == -1) طباعة (بيانات الرسم البياني غير قابلة للوصول: ، SubSymbol) ؛ عودة كاذبة)؛ if (n!) = _BarsCount) Print (لا يزال يتم تحميل بيانات المخطط: ، SubSymbol) ؛ عودة كاذبة)؛ العودة (صحيح)؛/ ----------------------------------------------- -------------------