Download MetaTrader 5

Ichimoku

To add comments, please log in or register
southraming80
20
southraming80  

Hi, 


I am creating this EA, will open an order when the two lines cross SenkouSpan A and SenkouSpan B. The problem is that it does not open when I cross 26 times forward. It opens the position when the crossing is above or below the y-axis of the current price. place the code maybe someone can help me please. Thank you in advance


order1order2

  
    double ichi3=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANA,0);  // I tried -26 int shift without any tangible result ...
    double ichi4=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANB,0);  // I tried -26 int shift without any tangible result ...


   if (Posizioni()==0   && ichi3>ichi4  && NewBar()  ) {

      ticketbuy=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Bid-StopLoss*Point,Ask+TakeProfit*Point,commentobuy,MagicNumber,0,clrGreen);


        }



   if (Posizioni()==0   && ichi3<ichi4  && NewBar()  ) {

      ticketsell=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Ask+StopLoss*Point,Bid-TakeProfit*Point,commentosell,MagicNumber,0,clrRed);


        }
southraming80
20
southraming80  

I'm trying everything but I just can not solve. network not found anything useful on this topic in particular. I really need help please. Thank you

Roberto Jacobs
48598
Roberto Jacobs  
southraming80:

I'm trying everything but I just can not solve. network not found anything useful on this topic in particular. I really need help please. Thank you

Have you tried:

 double ichi3=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANA,26);  // I tried -26 int shift without any tangible result ...
 double ichi4=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANB,26);  // I tried -26 int shift without any tangible result ...
southraming80
20
southraming80  
Roberto Jacobs:

Have you tried:


Thank you for answer.


yes, 26 thus opens the position 26 times after crossing ... I should do 26 times before, but it does not work, is not accurate ... I tried -26 but clearly something is wrong, I think it's not just a matter of changing this number. At least I think so

Roberto Jacobs
48598
Roberto Jacobs  
southraming80:


Thank you for answer.


yes, 26 thus opens the position 26 times after crossing ... I should do 26 times before, but it does not work, is not accurate ... I tried -26 but clearly something is wrong, I think it's not just a matter of changing this number. At least I think so

Have you tried:

 
//-- in fact code for Ichimoku been made very easy by MQL4 and MQL5

double ichi3=iIchimoku(Symbol(),0,9,26,52,MODE_SENKOUSPANA,0); // should function properly
double ichi4=iIchimoku(Symbol(),0,9,26,52,MODE_SENKOUSPANB,0); // should function properly
southraming80
20
southraming80  
Roberto Jacobs:

Have you tried:


yes man, default setting  tried, no  setting problem. 
i need  open position when senkou span a and b crossing  up or down 26 period forward.

thanks for help,  but it' not be solution :(

Roberto Jacobs
48598
Roberto Jacobs  
southraming80:


yes man, default setting  tried, no  setting problem. 
i need  open position when senkou span a and b crossing  up or down 26 period forward.

thanks for help,  but it' not be solution :(

I see..You can try: 

if price_close > ichi4 // buy

if price_close < ichi4 // sell

whroeder1
16058
whroeder1  
southraming80: will open an order when the two lines cross SenkouSpan A and SenkouSpan B. Th
&& ichi3>ichi4  &&
That code does not check for a cross. Just one above the other.
double ichi3Cur=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANA,26);
double ichi4Cur=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANB,26); 
double ichi3Pre=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANA,27);
double ichi4Pre=iIchimoku(Symbol(),0,TenkanSen,KijunSen,ChikouSpanB,MODE_SENKOUSPANB,27); 
bool  isUp = ichi3Cur > ichi4Cur;
bool wasUp = ichi3Pre > ichi4Pre;
bool cross = isUp != wasUp;
southraming80
20
southraming80  
whroeder1:
That code does not check for a cross. Just one above the other.


Thank you!
Now it worked with periods -26 and -27 for cross!!!

Really Thank you! 

southraming80
20
southraming80  
Roberto Jacobs:

I see..You can try: 

if price_close > ichi4 // buy

if price_close < ichi4 // sell


roberto Thank you.
To add comments, please log in or register