You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The code compiles with no errors but it does not work in live trading mode. Why ?
Any help or fixes most welcome..
PS.. Well done MT tech guys, some great new features in MT4
GT....
//+------------------------------------------------------------------+
//| PV1.mq4 |
//| mpfx |
//| http://www.stideas.com |
//+------------------------------------------------------------------+
#property copyright "mpfx"
#property link "http://www.stideas.com"
extern double TakeProfit = 0;
extern double Lots = 1;
extern double TrailingStop = 99;
extern double Stoploss = 17;
extern double Pips = 16;
extern double RSD = 1.2;
extern double Perc = 5;
double Points;
int init ()
{
Points = MarketInfo (Symbol(), MODE_POINT);
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
// TODO: Add your work code here.
double RSIP=0, RSIL=0, Levv=0;
int cnt=0, total;
if(Bars<10)
{
Print("bars less than 100");
return(0);
if(OrdersTotal()<1)
{
if(AccountFreeMargin()<(1*Lots))
{
Print("We have no money");
return(0);
Levv= AccountEquity()*(Perc/100/100)/10;
RSIP=iRSI(NULL,0,13,0,PRICE_CLOSE,0,0);
RSIL=iRSI(NULL,0,13,0,PRICE_CLOSE,0,1);
// (BUY)
if ((RSIP-RSIL > RSD) && Low[0] < Low[1]);
{
OrderSend(OP_BUY,Levv,Ask,3,Low[0]-Stoploss*Points,0,0,0,Red);
return(0);
}
if ((RSIP-RSIL > RSD) && Low[0] < Low[1]+Pips*Points);
{
OrderSend(OP_BUY,Levv,Ask,3,Low[0]-Stoploss*Points,0,0,0,Red);
return(0);
}
// (SELL)
if ((RSIP < (RSIL - RSD)) && High[0] < High[1]);
{
OrderSend(OP_SELL,Levv,Bid,3,High[0]+Stoploss*Points,0,0,0,Red);
return(0);
}
if ((RSIP < RSIL - RSD) && High[0] < High[1]-Pips*Points);
{
OrderSend(OP_SELL,Levv,Bid,3,High[0]+Stoploss*Points,0,0,0,Red);
return(0);
};
return(0);
}
}
}
};
int cnt=0, total;
total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY)
{
if ((RSIP < RSIL - RSD) && High[0] < High[1]);
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
return(0);
}
}
}
};
total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_BUY &&
OrderSymbol()==Symbol())
{
if(OrderType()==OP_SELL)
{
if ((RSIP-RSIL > RSD) && Low[0] < Low[1]);
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
return(0);
};
}
}
}