Download MetaTrader 5
To add comments, please log in or register
Order the development and track its status via your mobile phone.
Brt88
126
Brt88 2016.07.18 10:35 

Hi.

I would like to add to my open conditions sth like that:

OrderOpenTime()  of last trade + 4 Hours <= TimeCurrent()


plz help

whroeder1
13619
whroeder1 2016.07.18 13:44  
Brt88: I would like to add to my open conditions
learn to code it, or pay someone. We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Vasyl Nosal
18212
Vasyl Nosal 2016.07.18 20:10  
https://www.mql5.com/en/forum/91432/page2#comment_2662193
Brt88
126
Brt88 2016.07.19 11:02  
WHRoeder:
Brt88: I would like to add to my open conditions
learn to code it, or pay someone. We're not going to code it FOR you.
We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

U R right :) but im learning to code so its not easy.

Nature of problem: I want to find moments of false breakouts over d1 highs and lows in period of 5 previous days. I made loop but it doesnt for properly. I would like to make it check for i=5 that daily high[5]> H[4],H[3],H[2] and H[1]

but in case of i=2 i will compare: daily high[2]> daily high[1] .  My attempt below with next conditions to fulfill.

 //--- sell conditions
  for (i=5; i>1;i--)
      //{ for(n=i-1; n>0; n--)
            { if (iHigh(NULL,PERIOD_D1,i)>iHigh(NULL,PERIOD_D1,n)) 
               {if (     
                    High[1] > iHigh(NULL,PERIOD_D1,i)          
                   && Close[1] < iHigh(NULL,PERIOD_D1,i)   
                   && High[1] == iHigh(NULL,PERIOD_D1,0)    
                   &&  (SLs-Close[1]) <wprofit*ATRd     
                   && (High[1]-Close[1])>( Close[1]-Low[1])           
                   && 10000*( iHigh(NULL,PERIOD_D1,0)-iHigh(NULL,PERIOD_D1,i))>= 5  
                   && TimeCurrent()- LastOpenTime()> 4*60*60 
                     )
                        {
                      // OrderSend(Symbol(),OP_SELL,0.1,Bid,3,SLs,TPs0,"",11111111,0,Red);
                      res=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,SLs,TPs,"",MAGICMA,0,Red);
                      return;
                         } 
             }  //}
       }
/
To add comments, please log in or register