Experts: RSI trader v1

 

RSI trader v1:

Trades on RSI indicator.

Author: Tonny Obare

 

Backtest please ?

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

 
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);
}
 
Stop advertising here! :-(
 
tonny:
Stop advertising here! :-(

Sorry, no offence plz just trying to compare the codes ;-)
 

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

 

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

 

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

 
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.
 

Dear Tonny,

What does "Slip"  mean in the settings?  

 
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)?
Reason: