My simple code is not workging Need help please?

 

Hai i am new to forext trading and EA creating .

i am creating a EA with strategy tune site that is working in all other demo mt4 platforms but i try with my easy-forex live account it is not working

anybody can you help me to solve the problem?

#define __STRATEGY_MAGIC 2065796770

//Inputs

//Declaration
double _Ma_Fast;
double _Ma_Slow;
bool _Compare;
bool _Compare_2;
bool _Buy;
bool _Sell;
bool _Buy1;
bool _Sell1;

int start(){

   //Level 1
   _Ma_Fast = iMA(Symbol(),0,28,0,0,0,0);
   _Ma_Slow = iMA(Symbol(),0,14,0,0,0,0);

   //Level 2
   _Compare = _Ma_Fast > _Ma_Slow;
   _Compare_2 = _Ma_Fast < _Ma_Slow;

   //Level 3
   if(!_Compare && !__isExist(198372))_Buy = OrderSend(Symbol(),0,0.01,MarketInfo(Symbol(),MODE_ASK),0,0,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*50,"",__STRATEGY_MAGIC + 198372)>=0;
   if(_Compare && !__isExist(198392))_Sell = OrderSend(Symbol(),1,0.01,MarketInfo(Symbol(),MODE_BID),0,0,MarketInfo(Symbol(),MODE_BID)-MarketInfo(Symbol(),MODE_POINT)*50,"",__STRATEGY_MAGIC + 198392)>=0;
   if(!_Compare_2 && !__isExist(198352))_Buy1 = OrderSend(Symbol(),0,0.01,MarketInfo(Symbol(),MODE_ASK),0,0,MarketInfo(Symbol(),MODE_ASK)+MarketInfo(Symbol(),MODE_POINT)*50,"",__STRATEGY_MAGIC + 198352)>=0;
   if(_Compare_2 && !__isExist(198362))_Sell1 = OrderSend(Symbol(),1,0.01,MarketInfo(Symbol(),MODE_BID),0,0,MarketInfo(Symbol(),MODE_BID)-MarketInfo(Symbol(),MODE_POINT)*50,"",__STRATEGY_MAGIC + 198362)>=0;
   return(0);
}

//Services
bool __selectOrderByMagic(int __magic){for(int __i=0;__i<OrdersTotal();__i++){if(OrderSelect(__i,SELECT_BY_POS,MODE_TRADES)&&OrderMagicNumber()==__STRATEGY_MAGIC+__magic)return(true);}return(false);}
bool __isExist(int __magic){return(__selectOrderByMagic(__magic));}
 

Do you get the smiley face when you attach the Expert to the chart?

Do you get any error messages in the terminal log when attached?

Did you enable live trading within the terminal and for the Expert? 

 
arunamano:

Hai i am new to forext trading and EA creating .

i am creating a EA with strategy tune site that is working in all other demo mt4 platforms but i try with my easy-forex live account it is not working

anybody can you help me to solve the problem?

Is your Broker an ECN type Broker ?
 
ubzen:

Do you get the smiley face when you attach the Expert to the chart?

Do you get any error messages in the terminal log when attached?

Did you enable live trading within the terminal and for the Expert? 


Yes i got the smiley face , no error message, and also i enable to live trading but not working. 
 
RaptorUK:
Is your Broker an ECN type Broker ?


No my broker is not in ECN list.
 
arunamano: Yes i got the smiley face , no error message, and also i enable to live trading but not working.  
Try adding a line_by_line print() statement within the start() and see if it prints.
 
arunamano:

Yes i got the smiley face , no error message, and also i enable to live trading but not working. 
You are going to have to get your hands dirty and debug the code that was written for you . . . .  find out if the conditions do actually exist for a trade to be placed,  find if the OrderSend() is being sent or not,  if it is sent does it fail ?   you should add some proper error reporting to this code:  What are Function return values ? How do I use them ?
 
ubzen:
Try adding a line_by_line print() statement within the start() and see if it prints.


I tried  adding that line but it is not responding. 
 

can you get this to work

void start(){
    Print("Testing...123");
}
 
RaptorUK:
You are going to have to get your hands dirty and debug the code that was written for you . . . .  find out if the conditions do actually exist for a trade to be placed,  find if the OrderSend() is being sent or not,  if it is sent does it fail ?   you should add some proper error reporting to this code:  What are Function return values ? How do I use them ?


for my knowledge i checked  and  change the OrderSend()  but still like the same. 

 
arunamano:


for my knowledge i checked  and  change the OrderSend()  but still like the same. 

What do you have in your Expert log ?
Reason: