stuck at the candle

Back to topics list To post a new topic, please log in or register
avatar
2
fx0002 2016.06.16 10:36
 

Hello everyone !

Good Afternoon!

I am going through a problem i have build an EA but it is behaving strange .

It works fine for five to six trades but after it on 7th trade or any further trade it places trade hits TP and after it it started to place pending orders close it and again places a trade and again close it .

I don't know which thing is causing this problem . I also use GetLasterror function for trapping the error but no error was found.

Hope so that someone know about this problem or for its solution.

Thanks !! : )

 

avatar
1197
FMIC 2016.06.16 10:43 #
 

How to you expect us to help when you have not provide any code or in the very least a well detailed explanation?

We cannot read minds!

avatar
2
fx0002 2016.06.16 13:16 #
 
FMIC:

How to you expect us to help when you have not provide any code or in the very least a well detailed explanation?

We cannot read minds!

Sorry here is code which sends the order and check indicator price on every new tick  !!
void OnTick()
{
 double rsi iRSI(Symbol(),NULL,14,PRICE_CLOSE,0);
 double rsi1 iRSI(Symbol(),NULL,14,PRICE_CLOSE,1);
 
 orderclose() ;   // close pending if last order was closed in profit

 if(OrdersTotal() == 0)
 {
  if( rsi1 < 70 && rsi > 70   )
   {
    ordersendsell();    // Market order
    ordersend_sell2();  // Pending order 
    ordersend_sell3();  // Pending order 
    ordersend_sell4();  // Pending order 

   }
  else if ( rsi1 > 25 && rsi < 25 )
   {
    ordersendbuy();   // Market order 
    ordersend_buy2();  // Pending order 
    ordersend_buy3();  // Pending order 
    ordersend_buy4();  // Pending order 

   } 
  else
  {
  Alert("last known errorr == ", GetLastError());
  } 
 }

}

avatar
1197
FMIC 2016.06.16 13:35 #
 
fx0002:
Sorry here is code which sends the order and check indicator price on every new tick  !!

That is not valid code! It is just a "skeleton"! We cannot possibly "decipher" what the problem is from that. If you want to us to be able to help you, then you have to be willing to be forthcoming with your code. If you don't want to do that, then you will just have to figure it out on your own or consult with someone you can trust enough to be able to show them your code.

However, I can at least see one problem that is an example of "bad" programming logic. You cannot just use "if(OrdersTotal() == 0)" because that makes your EA incompatible with other EA's running or even itself when running on multiple charts.

As for other problems, I cannot say, because the code you provided is just not enough to be able to analyse properly.

Back to topics list  

To add comments, please log in or register