I pasted mq4 file into experts folder but it does not create ex4 file and EA icon has inactive color in EA manu
is there any error in the code? I am not expert
//+------------------------------------------------------------------+
//| simple EA.mq4 |
//| Copyright 2011, luktom.biz |
//| www.luktom.biz/en |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, luktom.biz."
#property link "http://www.luktom.biz"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
(0) return;
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit ()
{
//----
Print (countOrders (magic, OP_BUY));
//----
(0) return;
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
Print (AccountCurrency ());
//----
if (isGoodTime (Begin, End))
{
short = 0;
long = 0;
if (! cond)
{
l
if (! isGoodTime (Begin, End) & & cond2)
{
if (countOrders (magic, OP_SELL) == 0)
{
if (Bid « = (CRL-0.0005) & & short == 0)
{
short + +;
if (isECN == false)
{
OrderSend (Symbol (), OP_SELL, lots, Bid, slippage, sltpValue (Ask + stopLoss * Point, stopLoss), sltpValue (Ask-takeProfit * Point, takeProfit), comment, magic);
}
if (isECN)
{
ticket = OrderSend (Symbol (), OP_SELL, lots, Bid, slippage, 0,0, comment, magic);
OrderSelect (ticket, SELECT_BY_TICKET);
OrderModify (ticket, OrderOpenPrice (), sltpValue (Ask + stopLoss * Point, stopLoss), sltpValue (Bid-takeProfit * Point, takeProfit), 0);
}
}
}
if (countOrders (magic, OP_BUY) == 0)
{
if ((Ask-high) > = 0.005 & & long = = 0)
{
long + +;
if (isECN == false)
{
OrderSend (Symbol (), OP_BUY, lots, Ask, slippage, sltpValue (Ask-stopLoss * Point, stopLoss), sltpValue (Bid + takeProfit * Point, takeProfit),Y_TICKET);
OrderModify (ticket, OrderOpenPrice (), sltpValue (Bid-stopLoss * Point, stopLoss), sltpValue (Ask + takeProfit * Point, takeProfit), 0);
}
}
}
}
//----
(0) return;
}
//+------------------------------------------------------------------+
bool isGoodTime (string, string, Begin, End) {
if (TimeCurrent () > Localtime (Begin) & & TimeCurrent < Localtime () (End)) {
return (true);
}
return (false);
}
int countOrders (int, int oMagic oType) {
int count = 0;
}
}
}
}
}
return (count);
}
double sltpValue (double, int w1 w2)
{
if (w2 = = 0)
return (0);
return (NormalizeDouble (w1, Digits));
}
is there any error in the code? I am not expert
//+------------------------------------------------------------------+
//| simple EA.mq4 |
//| Copyright 2011, luktom.biz |
//| www.luktom.biz/en |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, luktom.biz."
#property link "http://www.luktom.biz"
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
(0) return;
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit ()
{
//----
Print (countOrders (magic, OP_BUY));
//----
(0) return;
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
Print (AccountCurrency ());
//----
if (isGoodTime (Begin, End))
{
short = 0;
long = 0;
if (! cond)
{
l
if (! isGoodTime (Begin, End) & & cond2)
{
if (countOrders (magic, OP_SELL) == 0)
{
if (Bid « = (CRL-0.0005) & & short == 0)
{
short + +;
if (isECN == false)
{
OrderSend (Symbol (), OP_SELL, lots, Bid, slippage, sltpValue (Ask + stopLoss * Point, stopLoss), sltpValue (Ask-takeProfit * Point, takeProfit), comment, magic);
}
if (isECN)
{
ticket = OrderSend (Symbol (), OP_SELL, lots, Bid, slippage, 0,0, comment, magic);
OrderSelect (ticket, SELECT_BY_TICKET);
OrderModify (ticket, OrderOpenPrice (), sltpValue (Ask + stopLoss * Point, stopLoss), sltpValue (Bid-takeProfit * Point, takeProfit), 0);
}
}
}
if (countOrders (magic, OP_BUY) == 0)
{
if ((Ask-high) > = 0.005 & & long = = 0)
{
long + +;
if (isECN == false)
{
OrderSend (Symbol (), OP_BUY, lots, Ask, slippage, sltpValue (Ask-stopLoss * Point, stopLoss), sltpValue (Bid + takeProfit * Point, takeProfit),Y_TICKET);
OrderModify (ticket, OrderOpenPrice (), sltpValue (Bid-stopLoss * Point, stopLoss), sltpValue (Ask + takeProfit * Point, takeProfit), 0);
}
}
}
}
//----
(0) return;
}
//+------------------------------------------------------------------+
bool isGoodTime (string, string, Begin, End) {
if (TimeCurrent () > Localtime (Begin) & & TimeCurrent < Localtime () (End)) {
return (true);
}
return (false);
}
int countOrders (int, int oMagic oType) {
int count = 0;
}
}
}
}
}
return (count);
}
double sltpValue (double, int w1 w2)
{
if (w2 = = 0)
return (0);
return (NormalizeDouble (w1, Digits));
}
kiss the trend