need help converting.simple horizontal line

Created at 07 Oct 2016, 07:22
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
IS

ishlah

Joined 20.01.2016

need help converting.simple horizontal line
07 Oct 2016, 07:22


Dear member .

 

could someone ins this forum help me out this.

i tried to convert with calgo with no success

 

//+------------------------------------------------------------------+
//|                             ProblemSolving_mhejek_161006_ind.mq4 |
//|                                                           Gorraf |
//+------------------------------------------------------------------+
#property copyright "Gorraf"
#property link      "set.gorraf@gmail.com"
#property indicator_chart_window

input datetime PS=0;      // Period Start
input datetime PE=0;      // Period End
input int MH=0;           // Marker (H) (enter a number from 0-23)
input int MM=0;           // Marker (M) (enter a number from 0-59)
input color MC=clrYellow; // Marker color
int CurBar, COa, BM, St, En;
datetime SavedTime;

int init()
        {BM=0;
         COa=Bars;
         while (COa>0)
               {ObjectDelete(0,StringConcatenate("M_",COa));
                COa--;};
         return(0);
         };
        
void OnDeinit(const int reason)
             {COa=Bars;
              while (COa>0)
                    {ObjectDelete(0,StringConcatenate("M_",COa));
                     COa--;};         
         };


int start()
   {
if (SavedTime<TimeCurrent() && BM!=1)
   {
    if (BM!=1 && Period()>=1440) {Alert("Marker line could not be drawn due to the chart period"); BM=1;};
    if (BM!=1 && Period()==240 && MM!=0 && MH!=0 && MH!=4 && MH!=8 && MH!=12 && MH!=16 && MH!=20) {Alert("Daily boxes could not be drawn. The input values for start or end time do not match the chart."); BM=1;};
    if (BM!=1 && Period()==60 && MM!=0) {Alert("Daily boxes could not be drawn. The input values for start or end time do not match the chart."); BM=1;};
    if (BM!=1 && Period()==30 && MM!=0 && MM!=30) {Alert("Daily boxes could not be drawn. The input values for start or end time do not match the chart."); BM=1;};
    if (BM!=1 && Period()==15 && MM!=0 && MM!=15 && MM!=30 && MM!=45) {Alert("Daily boxes could not be drawn. The input values for start or end time do not match the chart."); BM=1;};
    if (BM!=1 && Period()==5 && MM!=0 && MM!=5 && MM!=10 && MM!=15 && MM!=20 && MM!=25 && MM!=30 && MM!=35 && MM!=40 && MM!=45 && MM!=50 && MM!=55) {Alert("Daily boxes could not be drawn. The input values for start or end time do not match the chart."); BM=1;};

    if (BM!=1)
       {COa=Bars;
        while (COa>0)
              {ObjectDelete(0,StringConcatenate("M_",COa));
               COa--;};
    
        St=Bars; if (PS!=0) {St=iBarShift(Symbol(),Period(),PS);};
        En=0;    if (PE!=0) {En=iBarShift(Symbol(),Period(),PE);};
    
        CurBar=St;
        while (CurBar>=En)
              {if (TimeHour(iTime(Symbol(),Period(),CurBar))==MH && TimeMinute(iTime(Symbol(),Period(),CurBar))==MM)
                  {ObjectCreate(0,StringConcatenate("M_",CurBar),OBJ_HLINE,0,iTime(Symbol(),Period(),CurBar),iOpen(Symbol(),Period(),CurBar));
                   ObjectSetInteger(0,StringConcatenate("M_",CurBar),OBJPROP_COLOR,MC);
                   ObjectSetString(0,StringConcatenate("M_",CurBar),OBJPROP_TEXT,TimeToString(iTime(Symbol(),Period(),CurBar)));};
               CurBar--;};
        };

    if (SavedTime<TimeCurrent())
       {SavedTime=TimeCurrent()-((TimeHour(TimeCurrent())*60+TimeMinute(TimeCurrent()))*60)+(((MH*60)+MM)*60)+1;};
    if ((TimeHour(TimeCurrent())*60)+TimeMinute(TimeCurrent())>(MH*60)+MM)
       {SavedTime=SavedTime+(24*60*60);};
    };
        
return(0);
}

 

Best regard

 

VIcky


@ishlah