ma cross shift problem

 

mashift

 

 Hi

 I have  ma cross shift problem. I tried to make : two bars ago 20<50  , one bar ago 20>50  , current bar buy. Normally. it is a simple rule. But İt makes alot of buy-sell in current bar and cause lots of lose . My condition is  about past 2 and 1 bar ago. What is the reason. Could you  explain with my picture .What is the correct shift number. I want to restrict only one operation in one minute.  What should I do? What is difference shift and ma shift. 

Thanks everybody 

xxxxxxxxxxxxxxxxxxxxxxx 


 
Don't post Ads. This is mql4.com where's your coding question? You're off-topic for this forum.
 
kemal090909:

 Hi

 I have  ma cross shift problem. I tried to make : two bars ago 20<50  , one bar ago 20>50  , current bar buy. Normally. it is a simple rule. But İt makes alot of buy-sell in current bar and cause lots of lose . My condition is  about past 2 and 1 bar ago. What is the reason. Could you  explain with my picture .What is the correct shift number. I want to restrict only one operation in one minute.  What should I do? What is difference shift and ma shift. 

Thanks everybody 

xxxxxxxxxxxxxxxxxxxxxxx 


Perhaps you missed this when you registered . . .

Look here: https://www.mql5.com/en/users/register

It says . . . "4. Posting of advertising messages is forbidden. "

 
kemal090909:

  

 

 Hi

 I have  ma cross shift problem. I tried to make : two bars ago 20<50  , one bar ago 20>50  , current bar buy. Normally. it is a simple rule. But İt makes alot of buy-sell in current bar and cause lots of lose . My condition is  about past 2 and 1 bar ago. What is the reason. Could you  explain with my picture .What is the correct shift number. I want to restrict only one operation in one minute.  What should I do? What is difference shift and ma shift. 

Thanks everybody 

xxxxxxxxxxxxxxxxxxxxxxx 


Hello kemal,

Consider the following-

if(OrdersTotal()==0)
   if(ma1_shift2<=ma5_shift2)
      if(ma1_shift1>ma5_shift1)
         OrderSend(Symbol(),OP_BUY,Lots,Ask,30,StopLoss,TakeProfit,"",MagicNumber,0,Blue);

Notice the first 'if' condition, <= is used because sometimes ma1_shift2 closes right on ma5_shift2. If  < only is used, then issues arise if ma1_shift2 closes on ma5_shift2;

All links held on left side of documentation page (https://docs.mql4.com//) of the MQL4 site offer specific answers to many questions.

Thank you

Reason: