Download MetaTrader 5
To add comments, please log in or register
Let your idle PCs do something useful. Join MQL5 Cloud Network!
MetaQuotes Software Corp.
Moderator
177178
MetaQuotes Software Corp. 2012.06.14 08:42 

RSI trader v1:

Trades on RSI indicator.

Author: Tonny Obare

MQL4 Comments
16309
MQL4 Comments 2012.06.14 09:43  

Backtest please ?

My website : http://aide-forex.webou.net

MQL4 Comments
16309
MQL4 Comments 2012.06.15 08:28  
heres another one rsi trader which requires Functions mq4...
//+------------------------------------------------------------------+
//|                                                   RSI Trader.mq4 |
//|                                                 Copyright © 2007 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007"
#property link      ""
extern double    Lotsize=0.1;
extern int       TakeProfit=999;
extern int       StopLoss=999;
extern double    longbelow=5;
extern double    shortabove=75;
extern double    longcloseabove=95;
extern double    shortclosebelow=45;
extern double    rsiperiod=14;
extern int       slippage=3;
#include <Functions.mqh>
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  
double vla=0;
static int ticketaone=-1;
static int ticketaones=-1;
int magiclone=1001;
int magicsone=2001;
vla=iRSI(NULL,0,rsiperiod,PRICE_CLOSE,0);
if ((vla>longcloseabove)&&GOrdersTotalByMagic(magicsone)==1)
GCloseByMagic(magiclone);
if ((vla<shortclosebelow)&&GOrdersTotalByMagic(magiclone)==1)
GCloseByMagic(magicsone);
if ((vla<longbelow)&&GOrdersTotalByMagic(magiclone)==0)
ticketaone=OrderSend(Symbol(),OP_BUY,Lotsize,Ask,slippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Order started by RSI TRADER.",magiclone,0,Green);
 
if ((vla>shortabove)&&GOrdersTotalByMagic(magicsone)==0)
ticketaones=OrderSend(Symbol(),OP_SELL,Lotsize,Bid,slippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Order started by RSI TRADER.",magicsone,0,Green);
 
    
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
And heres the Function...
//+------------------------------------------------------------------+
//|                                                    Functions.mq4 |
//|                                                 Copyright © 2007 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""
int GOrdersTotalByMagic(int intMagic)
{
int intCount=0;
int intPOS=0;
bool boolTerm=false;
while(boolTerm==false)
{
if(OrderSelect(intPOS,SELECT_BY_POS))
{
if(OrderMagicNumber()==intMagic) intCount++;
intPOS++;
}
else
boolTerm=true;
}
return(intCount);
}
int GCloseByMagic(int intMagic)
{
int intOffset=0;
while(GOrdersTotalByMagic(intMagic)>0)
{
OrderSelect(intOffset,SELECT_BY_POS);
if(OrderMagicNumber()==intMagic)
{
if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),999,Red);
if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),999,Orange);
}
else {
intOffset++;
}
}
return(0);
}
Tonny Obare
1054
Tonny Obare 2012.06.15 09:10  
Stop advertising here! :-(
MQL4 Comments
16309
MQL4 Comments 2012.06.15 09:25  
tonny:
Stop advertising here! :-(

Sorry, no offence plz just trying to compare the codes ;-)
MQL4 Comments
16309
MQL4 Comments 2012.06.15 17:39  

Hi,

Just wondering if you could create a new EA or modify your RSI EA to trade with candlestick patterns...will be much efficient

1. Ability to trade in different time frames.

2. Opening Trade: After closing of two similar candle patterns whether for buy or sell, it should open open a trade in the direction of the last two similar Candle stick pattern...otherwise wait for last two candles to be similar to open a trade.

3. Exit Trade: It should wait to close the trade immediately until the formation of next candle pattern in opposite direction of the opened trade. And start all over again to repeat the same procedure as above to open a new trade.

4. Adjustable TP, SL & TS. Default should be zero. // whichever hits first, SL or formation of opposite candles...should close position


5. Instead of

extern double BuyPoint=30;

extern double SellPoint=70;

should be

extern double OpenNumberOfcandles=2; // no. of candle patterns after which the EA will open trades
extern double ExitNumberOfcandles=1; // formation of opposite candle(default is opposite i.e 1) or no. of candle patterns after which the EA will close trades...whichever chosen

It will open more trades in M1 and less in H1. But it may help to test the best timeframes.


Regards

MQL4 Comments
16309
MQL4 Comments 2012.06.18 10:59  

Hi Tonny as a newbie here I'm interested on how one applies these "Codes" into the chart, program?


my mail address outre@iburst.co.za

thanks John 151948

MQL4 Comments
16309
MQL4 Comments 2012.06.19 11:07  

Hi

I am new to this, have downloaded and installed it, also it is in EUR/USD chart with smiley face on right top corner, it says in Journal "loaded successfully" but it doesnt do anything?

Should it be trading automatically or..???

thanks

Tonny Obare
1054
Tonny Obare 2012.06.19 12:01  
chandresh:

Hi

I am new to this, have downloaded and installed it, also it is in EUR/USD chart with smiley face on right top corner, it says in Journal "loaded successfully" but it doesnt do anything?

Should it be trading automatically or..???

thanks

Perhaps you didnt read this:


NOTE:

  1. The EA is designed for 5 digit brokers since most major brokers are 5 digit nowadays.
  2. Its up to you to discover the optimum settings for your strategy the default settings have not been tested/optimized.
tem
3
tem 2012.12.28 04:38  

Dear Tonny,

What does "Slip"  mean in the settings?  

Adrian Iorga
205
Adrian Iorga 2015.07.25 01:54  
Hi I just used your RSI trader and it's great but I have a question? Can you please tell me how can I set it to open multiple buy and sell orders in the same time (every time when RSI indicator touches the buy/sell points even if a previous order is still opened)?
/ /12
To add comments, please log in or register