//+------------------------------------------------------------------+
//| doshur Bot.mq4 |
//| doshur |
//| www.doshur.com |
//+------------------------------------------------------------------+
#property copyright "doshur"
#property link "www.doshur.com"
//---- input parameters
extern double StopLoss = 40;
extern double Lots = 0.1;
//----
int init()
{
return(0);
}
int deinit()
{
return(0);
}
//----
int start()
{
//---- General
double Spread = (Ask - Bid) / Point;
double Current_Price = iClose(NULL,1,1);
double PP = (iHigh(NULL,0,2) + iLow(NULL,0,2) + iClose(NULL,0,2)) / 3;
//---- MAs
double Now_MA_Signal, Prev_MA_Signal;
double Now_MA_MainClose, Prev_MA_MainClose;
Now_MA_Signal = iMA(NULL,0,5,0,MODE_LWMA,PRICE_CLOSE,1);
Prev_MA_Signal = iMA(NULL,0,5,0,MODE_LWMA,PRICE_CLOSE,2);
Now_MA_MainClose = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,1);
Prev_MA_MainClose = iMA(NULL,0,8,0,MODE_SMA,PRICE_CLOSE,2);
//---- MA Trend
double MA_Trend = iMA(NULL,0,13,0,MODE_SMMA,PRICE_CLOSE,0);
//---- MFI RSI POI
double RSI = iRSI(NULL,0,13,PRICE_CLOSE,1);
double MFI = iMFI(NULL,0,13,1);
double POI_Main = iCustom(NULL,1,"Perfect Over Indicator",13,13,13,0,1);
double POI_Signal = iCustom(NULL,1,"Perfect Over Indicator",13,13,13,1,1);
//---- Buy
if(Check_OpenTrades(1) < 1)
if(Current_Price > PP)
if(MFI < 40 && RSI > 50)
if(POI_Main > POI_Signal)
if(Now_MA_Signal > MA_Trend)
if(Now_MA_MainClose < Now_MA_Signal && Prev_MA_MainClose >= Prev_MA_Signal)
{
OrderSend(Symbol(),OP_BUY,Check_Lots(),Ask,3,0,0,"doshur",0,0,Blue);
}
//---- Close Buy
static bool BuyLoss = false;
int cntB = 0;
if(Now_MA_MainClose > Now_MA_Signal && Prev_MA_MainClose <= Prev_MA_Signal)
{
for(cntB = 0; cntB < OrdersTotal(); cntB++)
{
OrderSelect(cntB, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY)
if(OrderProfit() > Spread)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Black);
}
else
{
//if(MA_Trend > Now_MA_Signal)
// OrderClose(OrderTicket(),OrderLots(),Bid,3,Black);
BuyLoss = true;
}
}
}
/* 100% win
*/
if(BuyLoss == true)
if(MA_Trend > Now_MA_Signal)
{
for(cntB = 0; cntB < OrdersTotal(); cntB++) // close buy
{
OrderSelect(cntB, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY)
if(OrderProfit() > Spread)
OrderClose(OrderTicket(),OrderLots(),Bid,3,Black);
else
BuyLoss = true;
}
}
/*
*/
//----
return(0);
}
//+------------------------------------------------------------------+
//---- Check Open Trades
int Check_OpenTrades(int bs)
{
int buys = 0, sells = 0;
for(int c_OT = 0; c_OT < OrdersTotal(); c_OT++)
{
OrderSelect(c_OT, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY)
buys++;
if(OrderType() == OP_SELL)
sells++;
}
if(bs == 1)
return(buys);
if(bs == 2)
return(sells);
}
//---- Optimize Lots
double Check_Lots()
{
double rLots;
rLots = NormalizeDouble(AccountBalance() / 100 * 0.5 / 40,1); // account balance / margin * winning chance / stoploss
if(rLots < 0.1)
rLots = 0.1;
return(rLots);
}
i think there's something wrong with my code?
100% win???
anyone pls comments.
thanks
I need the Perfect indicator to test your program
hi doshur,
OrderProfit() > Spread ... your EA only close when OrderProfit is reached.
Until the StopOut is calling you .... :-)
updated up code again
pls help to improve and make suggesstions
final code updated!
test long only and it works great
short works lousy and i dont know y?
tester and suggestions please.
i am tested 2008.01.01 - today. result is profit . first balance=10000 last Balance is 34034 (EURUSD M5 - StopLost=50, Trailing Stop=40)
what do u think of my EA?
Can someone post the POI.zip package?
I tried getting it from doshur.com, but don't see the website.
Would love to play and test this further.
Thanks, Snow. :)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
//+------------------------------------------------------------------+
//| doshur Bot.mq4 |
//| doshur |
//| www.doshur.com |
//+------------------------------------------------------------------+
#property copyright "doshur"
#property link "www.doshur.com"
i have improved on the code but i need help to fine tune again without making major changes.
download the code
POI indicator
http://www.doshur.com/MT4/POI.zip
testing
5min eur/usd