+
2 8 1 2 3 4 5 6 7 8
11 20 75

: .

  1. #11
    ClusterDelta.com Member
    31.12.2011
    406
    ()
    173
    481 () 227
    member_d
    . . . . . .
    :

    string myday="D"+"'"+Year()+"."+Month()+"."+(Day()-1)+" "+"21"+":"+"00"+"'";
    int mybar=iBarShift(NULL, 0, myday);
    Comment (mybar);
    return(0);

    , , D'2012.11.01 15:00' , . mayday , .
    D . Doubletostr

    string myday=Year()+"."+Month()+"."+(Day()-1)+" "+"21"+":"+"00"+"'";
    int mybar=iBarShift(NULL, 0, myday);
    Comment (mybar);
    return(0);

  2. #12

    20.09.2012
    14
    ()
    13
    7 () 6
    . , . , iBarShift : iBarShift(NULL, 0, D'2012.11.27 15:00') 15- 27- . , , . - .

  3. #13
    ClusterDelta.com Team
    27.10.2011
    3,773
    ()
    434
    2,076 () 1,056
    member_d
    . , . , iBarShift : iBarShift(NULL, 0, D'2012.11.27 15:00') 15- 27- . , , . - .
    ArrayBSearch ?

    DateTime my_variable=D'2012.11.27 15:00';
    int s = ArrayBsearch(Time,my_variable);

  4. #14

    20.09.2012
    14
    ()
    13
    7 () 6
    , . . . - . open . . MQL4 - - , . ? , , - .

  5. #15

    01.05.2012
    4
    ()
    0
    0 () 0
    !
    mql4. . , .

  6. #16
    ClusterDelta.com Team
    27.10.2011
    3,773
    ()
    434
    2,076 () 1,056
    :

    ObjectCreate(rec_name,OBJ_TREND,0,1,1, 2,2);
    ObjectSet(rec_name,OBJPROP_RAY, false);
    ObjectSet(rec_name,OBJPROP_COLOR,);

  7. #17

    01.05.2012
    4
    ()
    0
    0 () 0
    . , , int init() {, int deinit() {, int start() { -?

  8. #18
    ClusterDelta.com Team
    12.11.2011
    3,846
    ()
    626
    1,735 () 1,212



    combo_bars_daily



    4

    combo_bars_daily_1.7.ex4

    combo_bars_daily_1.7.zip












  9. #19
      Fox.RM
    24.04.2013
    55
    ()
    4
    39 () 11
    - CumDelta 4?
    , :

    //+------------------------------------------------------------------+
    //| ClusterDelta_CumDelta_Div.mq4 |
    //+------------------------------------------------------------------+
    #property copyright ""
    #property link ""
    //----
    #property indicator_separate_window
    #property indicator_buffers 4
    #property indicator_color1 Blue
    #property indicator_color2 Green
    #property indicator_color3 Red
    #property indicator_width1 1
    #property indicator_width2 2
    #property indicator_width3 2

    //---- input parameters
    extern string separator3 = "*** Indicator Settings ***";
    extern bool drawDivergenceLines = true;
    extern bool displayAlert = false;
    //---- buffers
    double Momentum[];
    double bullishDivergence[];
    double bearishDivergence[];
    double MomDiv[];
    //----
    static datetime lastAlertTime;
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function |
    //+------------------------------------------------------------------+
    int init()
    {
    //---- indicators
    SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 0);
    SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 0);
    SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, 0);
    SetIndexStyle(3, DRAW_NONE);
    //----
    SetIndexBuffer(0, Momentum);
    SetIndexBuffer(1, bullishDivergence);
    SetIndexBuffer(2, bearishDivergence);
    SetIndexBuffer(3, MomDiv);
    //----
    SetIndexArrow(1, 233);
    SetIndexArrow(2, 234);
    //----
    IndicatorDigits(Digits + 2);
    IndicatorShortName("ClusterDelta_Div");
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custom indicator deinitialization function |
    //+------------------------------------------------------------------+
    int deinit()
    {
    for(int i = ObjectsTotal() - 1; i >= 0; i--)
    {
    string label = ObjectName(i);
    if(StringSubstr(label, 0, 14) != "DivergenceLine")
    continue;
    ObjectDelete(label);
    }
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function |
    //+------------------------------------------------------------------+
    int start()
    {
    int countedBars = IndicatorCounted();
    if(countedBars < 0)
    countedBars = 0;
    CalculateIndicator(countedBars);
    return(0);
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void CalculateIndicator(int countedBars)
    {
    for(int i = 300; i >= 0; i--)
    {
    CalculateMomDiv(i);
    CatchBullishDivergence(i + 2);
    CatchBearishDivergence(i + 2);
    }
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void CalculateMomDiv(int i)
    {
    Momentum[i] = iCustom(NULL, 0, "ClusterDelta_CumDelta", 0, i);
    MomDiv[i] = Momentum[i];
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void CatchBullishDivergence(int shift)
    {
    if(IsIndicatorTrough(shift) == false)
    return;
    int currentTrough = shift;
    int lastTrough = GetIndicatorLastTrough(shift);
    if(MomDiv[currentTrough] > MomDiv[lastTrough] && Low[currentTrough] < Low[lastTrough])
    {
    bullishDivergence[currentTrough] = MomDiv[currentTrough];
    if(drawDivergenceLines == true)
    {
    DrawPriceTrendLine(Time[currentTrough], Time[lastTrough], Low[currentTrough],
    Low[lastTrough], Green, STYLE_SOLID);
    DrawIndicatorTrendLine(Time[currentTrough], Time[lastTrough], MomDiv[currentTrough],
    MomDiv[lastTrough], Green, STYLE_SOLID);
    }
    if(displayAlert == true)
    DisplayAlert("Classical bullish divergence on: ", currentTrough);
    }
    if(MomDiv[currentTrough] < MomDiv[lastTrough] && Low[currentTrough] > Low[lastTrough])
    {
    bullishDivergence[currentTrough] = MomDiv[currentTrough];
    if(drawDivergenceLines == true)
    {
    DrawPriceTrendLine(Time[currentTrough], Time[lastTrough], Low[currentTrough],
    Low[lastTrough], Green, STYLE_DOT);
    DrawIndicatorTrendLine(Time[currentTrough], Time[lastTrough], MomDiv[currentTrough],
    MomDiv[lastTrough], Green, STYLE_DOT);
    }
    if(displayAlert == true)
    DisplayAlert("Reverse bullish divergence on: ", currentTrough);
    }
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void CatchBearishDivergence(int shift)
    {
    if(IsIndicatorPeak(shift) == false)
    return;
    int currentPeak = shift;
    int lastPeak = GetIndicatorLastPeak(shift);

    if(MomDiv[currentPeak] < MomDiv[lastPeak] && High[currentPeak] > High[lastPeak])
    {
    bearishDivergence[currentPeak] = MomDiv[currentPeak];
    if(drawDivergenceLines == true)
    {
    DrawPriceTrendLine(Time[currentPeak], Time[lastPeak], High[currentPeak],
    High[lastPeak], Red, STYLE_SOLID);
    DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak], MomDiv[currentPeak],
    MomDiv[lastPeak], Red, STYLE_SOLID);
    }
    if(displayAlert == true)
    DisplayAlert("Classical bearish divergence on: ", currentPeak);
    }
    if(MomDiv[currentPeak] > MomDiv[lastPeak] && High[currentPeak] < High[lastPeak])
    {
    bearishDivergence[currentPeak] = MomDiv[currentPeak];
    if(drawDivergenceLines == true)
    {
    DrawPriceTrendLine(Time[currentPeak], Time[lastPeak], High[currentPeak],
    High[lastPeak], Red, STYLE_DOT);
    DrawIndicatorTrendLine(Time[currentPeak], Time[lastPeak], MomDiv[currentPeak],
    MomDiv[lastPeak], Red, STYLE_DOT);
    }
    if(displayAlert == true)
    DisplayAlert("Reverse bearish divergence on: ", currentPeak);
    }
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    bool IsIndicatorPeak(int shift)
    {
    if(MomDiv[shift] >= MomDiv[shift+1] && MomDiv[shift] > MomDiv[shift+2] &&
    MomDiv[shift] > MomDiv[shift-1])
    return(true);
    else
    return(false);
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    bool IsIndicatorTrough(int shift)
    {
    if(MomDiv[shift] <= MomDiv[shift+1] && MomDiv[shift] < MomDiv[shift+2] &&
    MomDiv[shift] < MomDiv[shift-1])
    return(true);
    else
    return(false);
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    int GetIndicatorLastPeak(int shift)
    {
    for(int i = shift + 5; i < Bars; i++)
    {
    if(Momentum[i] >= Momentum[i+1] && Momentum[i] >= Momentum[i+2] &&
    Momentum[i] >= Momentum[i-1] && Momentum[i] >= Momentum[i-2])
    {
    for(int j = i; j < Bars; j++)
    {
    if(MomDiv[j] >= MomDiv[j+1] && MomDiv[j] > MomDiv[j+2] &&
    MomDiv[j] >= MomDiv[j-1] && MomDiv[j] > Momentum[j-2])
    return(j);
    }
    }
    }
    return(-1); }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    int GetIndicatorLastTrough(int shift)
    {
    for(int i = shift + 5; i < Bars; i++)
    {
    if(Momentum[i] <= Momentum[i+1] && Momentum[i] <= Momentum[i+2] &&
    Momentum[i] <= Momentum[i-1] && Momentum[i] <= Momentum[i-2])
    {
    for (int j = i; j < Bars; j++)
    {
    if(MomDiv[j] <= MomDiv[j+1] && MomDiv[j] < MomDiv[j+2] &&
    MomDiv[j] <= MomDiv[j-1] && MomDiv[j] < MomDiv[j-2])
    return(j);
    }
    }
    }
    return(-1); }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void DisplayAlert(string message, int shift)
    {
    if(shift <= 2 && Time[shift] != lastAlertTime)
    {
    lastAlertTime = Time[shift];
    Alert(message, Symbol(), " , ", Period(), " minutes chart");
    }
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void DrawPriceTrendLine(datetime x1, datetime x2, double y1,
    double y2, color lineColor, double style)
    {
    string label = "DivergenceLine2.1# " + DoubleToStr(x1, 0);
    ObjectDelete(label);
    ObjectCreate(label, OBJ_TREND, 0, x1, y1, x2, y2, 0, 0);
    ObjectSet(label, OBJPROP_RAY, 0);
    ObjectSet(label, OBJPROP_COLOR, lineColor);
    ObjectSet(label, OBJPROP_STYLE, style);
    }
    //+------------------------------------------------------------------+
    //| |
    //+------------------------------------------------------------------+
    void DrawIndicatorTrendLine(datetime x1, datetime x2, double y1,
    double y2, color lineColor, double style)
    {
    int indicatorWindow = WindowFind("ClusterDelta_Div");
    if(indicatorWindow < 0)
    return;
    string label = "DivergenceLine2.1$# " + DoubleToStr(x1, 0);
    ObjectDelete(label);
    ObjectCreate(label, OBJ_TREND, indicatorWindow, x1, y1, x2, y2, 0, 0);
    ObjectSet(label, OBJPROP_RAY, 0);
    ObjectSet(label, OBJPROP_COLOR, lineColor);
    ObjectSet(label, OBJPROP_STYLE, style);
    }
    //+------------------------------------------------------------------+

    . Momentuma.
    .

  10. #20
      Fox.RM
    24.04.2013
    55
    ()
    4
    39 () 11
    ?

+

     

 

ClusterDelta.com - . : , , , http://clusterdelta.com http://forum.clusterdelta.com , , , .


, , . , , , .


(C) 2009-2012 ClusterDelta.com. .

 

@Mail.ru