arsens' Journal
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 2 most recent journal entries recorded in arsens' LiveJournal:

    Friday, March 3rd, 2006
    3:18 pm
    StepMA_Stoch_v1
    [Error: Irreparable invalid markup ('<sminmin1)>') in entry. Owner must fix manually. Raw contents below.]

    //+------------------------------------------------------------------+
    //| StepMA_Stoch_v1.mq4 |
    //| Copyright © 2005, TrendLaboratory Ltd. |
    //| E-mail: igorad2004@list.ru |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2005, TrendLaboratory Ltd."
    #property link ""

    #property indicator_separate_window
    #property indicator_buffers 2
    #property indicator_color1 Yellow
    #property indicator_color2 DeepSkyBlue
    #property indicator_minimum 0
    #property indicator_maximum 1
    //---- input parameters
    extern int PeriodWATR=10;
    extern double Kwatr=1.0000;
    extern int HighLow=0;
    //---- indicator buffers
    double LineMinBuffer[];
    double LineMidBuffer[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function |
    //+------------------------------------------------------------------+
    int init()
    {
    string short_name;
    //---- indicator line
    SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
    SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
    SetIndexBuffer(0,LineMinBuffer);
    SetIndexBuffer(1,LineMidBuffer);
    IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
    //---- name for DataWindow and indicator subwindow label
    short_name="StepMA Stoch("+PeriodWATR+","+Kwatr+","+HighLow+")";
    IndicatorShortName(short_name);
    SetIndexLabel(0,"StepMA Stoch 1");
    SetIndexLabel(1,"StepMA Stoch 2");
    //----
    SetIndexDrawBegin(0,PeriodWATR);
    SetIndexDrawBegin(1,PeriodWATR);
    //----
    return(0);
    }

    //+------------------------------------------------------------------+
    //| StepMA_3D_v1 |
    //+------------------------------------------------------------------+
    int start()
    {
    int i,shift,TrendMin,TrendMax,TrendMid;
    double SminMin0,SmaxMin0,SminMin1,SmaxMin1,SumRange,dK,WATR0,WATRmax,WATRmin,WATRmid;
    double SminMax0,SmaxMax0,SminMax1,SmaxMax1,SminMid0,SmaxMid0,SminMid1,SmaxMid1;
    double linemin,linemax,linemid,Stoch1,Stoch2,bsmin,bsmax;

    for(shift=Bars-1;shift>=0;shift--)
    {
    SumRange=0;
    for (i=PeriodWATR-1;i>=0;i--)
    {
    dK = 1+1.0*(PeriodWATR-i)/PeriodWATR;
    SumRange+= dK*MathAbs(High[i+shift]-Low[i+shift]);
    }
    WATR0 = SumRange/PeriodWATR;

    WATRmax=MathMax(WATR0,WATRmax);
    if (shift==Bars-1-PeriodWATR) WATRmin=WATR0;
    WATRmin=MathMin(WATR0,WATRmin);

    int StepSizeMin=MathRound(Kwatr*WATRmin/Point);
    int StepSizeMax=MathRound(Kwatr*WATRmax/Point);
    int StepSizeMid=MathRound(Kwatr*0.5*(WATRmax+WATRmin)/Point);

    if (HighLow>0)
    {
    SmaxMin0=Low[shift]+2*StepSizeMin*Point;
    SminMin0=High[shift]-2*StepSizeMin*Point;

    SmaxMax0=Low[shift]+2*StepSizeMax*Point;
    SminMax0=High[shift]-2*StepSizeMax*Point;

    SmaxMid0=Low[shift]+2*StepSizeMid*Point;
    SminMid0=High[shift]-2*StepSizeMid*Point;

    if(Close[shift]>SmaxMin1) TrendMin=1;
    if(Close[shift]<SminMin1) TrendMin=-1;

    if(Close[shift]>SmaxMax1) TrendMax=1;
    if(Close[shift]<SminMax1) TrendMax=-1;

    if(Close[shift]>SmaxMid1) TrendMid=1;
    if(Close[shift]<SminMid1) TrendMid=-1;
    }

    if (HighLow == 0)
    {
    SmaxMin0=Close[shift]+2*StepSizeMin*Point;
    SminMin0=Close[shift]-2*StepSizeMin*Point;

    SmaxMax0=Close[shift]+2*StepSizeMax*Point;
    SminMax0=Close[shift]-2*StepSizeMax*Point;

    SmaxMid0=Close[shift]+2*StepSizeMid*Point;
    SminMid0=Close[shift]-2*StepSizeMid*Point;

    if(Close[shift]>SmaxMin1) TrendMin=1;
    if(Close[shift]<SminMin1) TrendMin=-1;

    if(Close[shift]>SmaxMax1) TrendMax=1;
    if(Close[shift]<SminMax1) TrendMax=-1;

    if(Close[shift]>SmaxMid1) TrendMid=1;
    if(Close[shift]<SminMid1) TrendMid=-1;
    }

    if(TrendMin>0 && SminMin0<SminMin1) SminMin0=SminMin1;
    if(TrendMin<0 && SmaxMin0>SmaxMin1) SmaxMin0=SmaxMin1;

    if(TrendMax>0 && SminMax0<SminMax1) SminMax0=SminMax1;
    if(TrendMax<0 && SmaxMax0>SmaxMax1) SmaxMax0=SmaxMax1;

    if(TrendMid>0 && SminMid0<SminMid1) SminMid0=SminMid1;
    if(TrendMid<0 && SmaxMid0>SmaxMid1) SmaxMid0=SmaxMid1;


    if (TrendMin>0) linemin=SminMin0+StepSizeMin*Point;
    if (TrendMin<0) linemin=SmaxMin0-StepSizeMin*Point;

    if (TrendMax>0) linemax=SminMax0+StepSizeMax*Point;
    if (TrendMax<0) linemax=SmaxMax0-StepSizeMax*Point;

    if (TrendMid>0) linemid=SminMid0+StepSizeMid*Point;
    if (TrendMid<0) linemid=SmaxMid0-StepSizeMid*Point;

    bsmin=linemax-StepSizeMax*Point;
    bsmax=linemax+StepSizeMax*Point;
    Stoch1=(linemin-bsmin)/(bsmax-bsmin);
    Stoch2=(linemid-bsmin)/(bsmax-bsmin);

    LineMinBuffer[shift]=Stoch1;
    LineMidBuffer[shift]=Stoch2;


    SminMin1=SminMin0;
    SmaxMin1=SmaxMin0;

    SminMax1=SminMax0;
    SmaxMax1=SmaxMax0;

    SminMid1=SminMid0;
    SmaxMid1=SmaxMid0;
    }
    return(0);
    }
    Friday, February 10th, 2006
    12:20 pm
    winner ind
    [Error: Irreparable invalid markup ('<ema50[i+1])&&(open[i]>') in entry. Owner must fix manually. Raw contents below.]

    //+------------------------------------------------------------------+
    //| CatFX50.mq4 |
    //| Copyright © 2005, MetaQuotes Software Corp. |
    //| http://www.metaquotes.net |
    //+------------------------------------------------------------------+
    #property copyright "Copyright © 2005, MetaQuotes Software Corp."
    #property link "http://www.forex-tsd.com/showthread.php?t=523"

    #property indicator_chart_window

    #property indicator_buffers 3
    #property indicator_color1 Blue
    #property indicator_color2 Red
    #property indicator_color3 Aqua
    //---- input parameters

    //Trading Time in server Time
    extern int confirm_StepMA_Bars=2;
    extern int TradeTimeFrom=0;
    extern int TradeTimeTo=24;
    extern int alert_ON=0;//ON=1,OFF=0
    extern int EMA_period=50;
    extern int StepMA_Stoch_PeriodWATR=10;
    extern int StepMA_Stoch_Kwatr=1.0000;
    extern int StepMA_Stoch_HighLow=0;
    //---- buffers
    double long[];
    double short[];
    double EMA50[];
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function |
    //+------------------------------------------------------------------+
    int init()
    {
    //---- indicators
    SetIndexStyle(0,DRAW_ARROW);
    SetIndexArrow(0,233);
    SetIndexBuffer(0,long);
    SetIndexEmptyValue(0,0.0);
    SetIndexStyle(1,DRAW_ARROW);
    SetIndexArrow(1,234);
    SetIndexBuffer(1,short);
    SetIndexEmptyValue(1,0.0);
    SetIndexStyle(2,DRAW_LINE);
    SetIndexLabel(2,"EMA50");
    SetIndexBuffer(2,EMA50);
    SetIndexStyle(2,DRAW_LINE);
    SetIndexEmptyValue(2,0.0);
    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custor indicator deinitialization function |
    //+------------------------------------------------------------------+
    int deinit()
    {
    //----

    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Custom indicator iteration function |
    //+------------------------------------------------------------------+
    int start()
    {
    int counted_bars=IndicatorCounted(),i,j;
    //---- check for possible errors
    if(counted_bars<0) return(-1);
    //---- last counted bar will be recounted
    if(counted_bars>0) counted_bars--;
    int limit=Bars-counted_bars;
    //variables
    double stepma00,stepma01,stepma10,stepma11;
    //Main roop
    for(i=limit; i>=0; i--)
    {

    EMA50[i]=iMA(NULL,0,EMA_period,0,MODE_EMA,PRICE_MEDIAN,i);
    if (TimeHour(Time[i])>=TradeTimeFrom&&TimeHour(Time[i])<=TradeTimeTo)
    {

    //Long check start
    if ((Open[i+1]<EMA50[i+1])&&(Open[i]>EMA50[i]))//cross EMA50
    {
    for (j=confirm_StepMA_Bars; j>=0; j--)
    {
    stepma00=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i+j);
    stepma01=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i+j);
    stepma10=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i+j+1);
    stepma11=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i+j+1);
    if ((stepma10<stepma11)&&(stepma00>stepma01))//StepMA cross
    {
    if (iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i)>iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i))
    {
    long[i]=(Low[i])-iATR(NULL,0,5,i)/2 ;
    if (i==0&&alert_ON==1)
    Alert(TimeToStr(Time[i],TIME_MINUTES)," CatFX50 ",Symbol()," BUY");
    }
    }
    }

    }
    //Long check end

    //Short check start
    if ((Open[i+1]>EMA50[i+1])&&(Open[i]<EMA50[i]))//cross EMA50
    {
    for (j=confirm_StepMA_Bars; j>=0; j--)
    {
    stepma00=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i+j);
    stepma01=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i+j);
    stepma10=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i+j+1);
    stepma11=iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i+j+1);
    if ((stepma10>stepma11)&&(stepma00<stepma01))//StepMA cross
    {
    if (iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,0,i)<iCustom(NULL,0,"StepMA_Stoch_v1",StepMA_Stoch_PeriodWATR,StepMA_Stoch_Kwatr,StepMA_Stoch_HighLow,1,i))
    {
    short[i]=High[i]+iATR(NULL,0,5,i)/2;
    if (i==0&&alert_ON==1)
    Alert(TimeToStr(Time[i],TIME_MINUTES)," CatFX50 ",Symbol()," SELL");
    }
    }
    }
    }
    //Short check end
    }
    }
    return(0);
    }
    //+------------------------------------------------------------------+
About Sviesta Ciba